Nearly 41 percent of third through eighth grade students were proficient in English; nearly 38 percent passed state math tests. View Full Caption Shutterstock

CIVIC CENTER — New York City’s students in grades three through eight saw their scores rise on state English exams — marking the first time that city students outperformed their state peers — while their scores on the math exams also inched up, Mayor Bill de Blasio and School Chancellor Carmen Fariña announced Tuesday.

For English, 40.6 percent of students met proficiency standards, up 2.6 percentage points from the year before, when 37.8 percent had passing grades. Those scores beat out the statewide average by 1.4 percentage points.

For math, 37.8 percent of students met the standards, up 1.3 points from the prior year’s 36.4 percent.

Mayor Bill de Blasio, Schools Chancellor Carmen Farina and other officials announced state tests scores on Tuesday. View Full Caption DNAInfo/Amy Zimmer

De Blasio said proficiency in both subjects improved across all ethnic groups, as well as for English Language Learners and students with disabilities.

“The gains are consistent across every borough and every background,” he said.

However, the achievement gap between races, persisted with 28.9 percent of black students and 29.7 percent of Hispanic students passing the English exams, compared to 61 percent for both white and Asian students. For math, 20.7 percent of black students and 25.3 percent of Hispanic students tested as proficient, compared to 67.8 percent of Asian students and 59 percent of white students.

“We need to close that achievement gap,” de Blasio said, noting that his various educational initiatives like Pre-K for All — giving all of the city’s 4-year-olds access to free pre-K instruction — will eventually pay dividends when it comes to performance on tests.

“I’m convinced that the building blocks are now in place. You’re going to see in the coming years, the effects of pre-K, which I think is going to be disproportionately positive for kids of color, who often did not get full-day early childhood education.”

The mayor believes that early childhood education efforts can help level the playing field the fastest.

“This is based on generations of disparity,” he added. “That doesn’t for a moment make us any less urgent in our desire to address it. We’re just clear-eyed that this is going to be a long battle. What’s good is we’re seeing consistent progress. People of color are doing better all the time.”

Fariña noted that it is important to attract new teachers to the field, particularly people of color, as the school system works to close the gap.

“If we’re going to close the gap, we want to make sure that people want to become teachers and that the teachers in front of people’s classrooms reflect who they are,” she said. “We’re doing a lot of recruiting on that.”

Leaders from charter schools highlighted the gains their students saw on the tests, particularly when comparing the performance of black and Hispanic children in charters versus traditional public schools.

“Charter students outperformed their district counterparts not only in the percent of children passing, but also in growth year over year,” James Merriman, CEO of the New York City Charter School Center, said in a statement.

To that end, de Blasio said, “We want all kids to do well in our system.”

While city officials noted that the exams are one of many measures to evaluate both students and their teachers, the controversial, high-stakes tests have spurred a grassroots movement of families opting their children out of the state tests. The tests are also being changed this school year to take up less time.

Both the English and math tests will be reduced from three to two days, following a change in 2016 to shorten the tests by a few questions and letting students take them without time constraints to relieve some stress.

Though the "opt out" movement is smaller in the city than the rest of the state, its numbers grew here. Roughly 4 percent of students — 17,234 children — refused to take either exam, compared to fewer than 3 percent — or roughly 13,000 — who sat out the exams the year before. (Statewide, 19 percent opted out.)

“I have said consistently I don’t believe in opt out,” said Fariña, who once said in a closed-door meeting that she supported it for students with special needs.

She hopes the shortened test will help take the temperature down on the tests, saying she was “emphatic” about not having schools teach to the test.

De Blasio also highlighted the rising scores at the city’s 57 failing elementary and middle schools, known as “renewal schools,” which have received significant investments to bolster supports for students — whether through an additional five hours a day of extended learning time or through mental-health services.

These schools saw proficiency on English tests jump 3.2 points, while math scores went up 1.3 points. But he expects to announce in November that some more renewal schools will be closing as their three-year time frame to show improvement is coming to a close.