It was an odd first test-score release for Mayor Bill de Blasio.

The mayor couldn’t help but celebrate the good news Thursday that the city’s scores on the third-through-eighth-grade state exams had inched back up after last year’s nosedive. But he also was aware that not too long ago he knocked his predecessor, Michael Bloomberg, for putting too much stock in test results. On top of that, de Blasio could hardly claim much credit for the gains, since he took office midway through the school year.

Meanwhile, there was the sobering fact that even as all students made progress, white and Asian students continue to perform far better than their black and Hispanic peers — with the gap between them actually widening. And even with the gains, nearly two-thirds of students still did not pass the tests, which for the second year were tied to the more demanding Common Core learning standards.

“We recognize the improvement this indicates,” de Blasio said outside a middle school in Bedford-Stuyvesant, Brooklyn. “But we have a long way to go.”

This year, 34.2 percent of city students passed the math exams, up 4.6 points from last year. In English, 28.4 percent of students passed, a one-point gain, according to city figures. That progress brought the city’s pass rate closer to the state average than it has been in years.

After touting those figures Thursday, de Blasio commended the previous administration for “their part of the equation.” Still, he pointed out, “In this year that bridged the two administrations, everyone contributed to the progress.”

But any attempted credit-taking was preempted by an email sent to reporters just as the press conference was starting titled, “Former New York City Schools Chancellor Dennis Walcott Touts Test Score Gains in Final Year of Bloomberg Administration.” In the statement, sent by a Bloomberg spokesman, Walcott attributed the gains in part to the creation of charter schools and stronger accountability systems — two Bloomberg policies that de Blasio has sharply criticized.

Later, de Blasio was asked about Walcott’s message. The mayor said he welcomed the news that the city’s charter schools did well on the tests. (Overall, they outperformed the city average in math, but lagged a little behind in English.) Still, he said that “in our system,” schools serve all students regardless of their needs and are moving away from test prep — which he said is not true of all charter schools.

Another message went out later from Michael Mulgrew, the city teachers union president who clashed bitterly with Bloomberg and is now aligned with de Blasio. Mulgrew pointed to the disparities among student groups. For instance, while nearly 56 percent of white students passed this year’s math tests, just over 15 percent of black students did — a gap that grew by more than two percentage points from last year.

“The racial achievement gap, which the Bloomberg administration kept claiming it was closing,” Mulgrew said in the statement, “remains a major problem that the schools and the new administration must focus on.”

Mulgrew added that student achievement begins with “well-supported” teachers. That was a message echoed by de Blasio and his schools chancellor, Carmen Fariña.

Fariña said a provision in the new teachers contract that sets aside time for educators to train and collaborate will help them to continue to adjust to the new standards. She added that thousands of teachers and 900 principals received training over the summer.

Such guidance will do more to improve classroom instruction than the previous administration’s accountability system, which included grading schools based on student performance, Fariña said.

“It’s about not pointing fingers and saying, ‘You’re a bad school,’” she said. “But let’s look at what it is you do and what support do you need.”

Despite their ambivalence about test scores, both Fariña and de Blasio set lofty goals for the coming years. Fariña said she would like to “double or triple” the current pass rates, while de Blasio insisted, “The goal is to have 100 percent proficiency for our children.”