For the first time in years, more New York City high schools are making the grade, at least according to one of the Department of Education’s assessments.

After four years during which the city doled out fewer and fewer top letter grades to high schools on annual progress reports, the department announced today that more high schools received A’s and B’s — and fewer had received failing grades.

In 2008, the percentage of high schools that received top letter grades topped out at 83 percent. In subsequent years, as the city sought to close many of its large comprehensive high schools and replace them with smaller ones, that rate has fallen — to 75 percent in 2009, 70 percent in 2010, and 65 percent in 2011.

This year, the rate of top-graded schools bounced back up to 72 percent. The proportion of schools that received failing grades fell from 12 percent to 7 percent.

The reversal comes at a time when city and state officials have said that high schools are, by and large, not preparing students for college. In fact, the city even added new data points to the progress reports designed to reward schools that produce college-ready graduates, and penalize those that do not.

The boost in high schools’ city grades also comes at a time when more middle and elementary schools got grades so low that they face closure.

Schools that receive an F, D, or three consecutive C’s or worse can be closed, according to the city’s rules. Earlier this year, the city announced that 217 elementary and middle schools fell into that category, an 80 percent increase over last year. The city is targeting 36 of those schools for possible closure, nearly twice as many as it did in 2011.

Mayor Bloomberg has said that closing failing middle schools and replacing them with new schools would be a major initiative of the last year of his mayoral term.

But the number of high schools that the department might target for closure this years decreased. Sixty high schools met the closure standards, and the department is considering closing 24 of them.

Progress reports have been released annually since 2007 as a way to measure how schools are performing. The city also uses the reports to justify decisions about school closures. The reports factor in more than two dozen data points, including graduation rates, scores on state Regents exams, course completion, attendance, and results from surveys of parents, students, and teachers.

Principals and education officials said the reason so many high schools got top scores for the first time in years was the city’s heightened emphasis on preparing students for college. New college-readiness metrics accounted for 10 percent of each school’s overall score.

“Our high schools are rising to the challenge of more rigorous standards and diploma requirements,” Chief Academic Officer Shael Polakow-Suransky said in a statement.

“It really highlighted some of our deficiencies,” Darryl White, principal of Bronx Collegiate Academy, said of the new metrics. Two percent of White’s students from the Class of 2011 were labeled “college ready,” according to the city’s standards, and the school received a B last year. So this fall,White said he introduced Advanced Placement courses to the school for the first time. This year Bronx Collegiate received an A.

“What I do appreciate is that it informs your of what your focus should be in the next year,” White said about the city’s strategy for grading schools.

In a press release, the department touted this year’s results as “generally stable.” Ninety-five percent of schools either maintained the same grade or changed by one grade from 2011.

Still, some schools saw a more precipitous decline.

Three schools fell from a C to a F, including Choir Academy of Harlem. Earlier this year, the Choir Academy’s middle school also tumbled significantly — from a B to a F. The school had been under investigation for cheating fraud and its former principal was abruptly fired in the middle of the last school year. The two other schools that saw similar declines were Bronx Regional High School and the Academy for Social Action.

Two high schools improved by three letter grades, from an F to a B: Gotham Professional Arts Academy and EBC High School for Public Service in Bushwick.