New York City students are taking and passing Advanced Placement courses at a higher rate than ever before, according to data released Tuesday by the city’s Department of Education.

The number of students taking at least one AP exam in 2016 rose by nearly 3,500 students citywide, and over 1,800 more students passed an AP exam in 2016 than in the previous year.

Black and Hispanic students saw the largest gains. Participation among black students increased by over 14 percent and the number of students passing at least one AP exam increased by 18 percent. Hispanic students increased both passing and participation rates by about 10 percent.

The increased participation and passing rates are part of a trend that started before Mayor Bill de Blasio took office, but the mayor has supported expanded access to AP classes during his tenure. Last September, de Blasio announced “AP for All,” a program designed to boost the number of AP classes in schools with an eye toward making sure low-income students and students of color have equal access to the college-level courses.

A 2015 report by the Center for New York City Affairs at the New School found that more than half the city’s high schools did not offer a single AP course in math and about half did not offer an AP course in science. Currently, approximately 370 of the city’s roughly 500 high schools offer at least one AP class, according to the city’s education department.

Schools granting the most Advanced Regents diplomas — a sign that students are taking and excelling in more advanced courses — were likely to have much higher concentrations of white and Asian students, the Center’s report found.

That research makes Tuesday’s announcement more noteworthy. “The increases in participation and performance we see today – particularly among black and Hispanic students – show that we’re moving in the direction of equity and excellence,” de Blasio said in a statement. “I look forward to the work ahead.”