A record number of New York City high school students are taking and passing Advanced Placement exams, the de Blasio administration said Tuesday.

According to figures released Tuesday by the city’s Department of Education, 44,906 students took at least one AP course in 2016, up from 41,419 in 2015, an 8.4 percent increase.

The number of AP test-takers who passed at least one exam rose by 8.2 percent.

De Blasio said the largest gains were among black and Hispanic students: Fourteen percent more black students are taking the exams and 18 percent more are passing, and nearly 10 percent more Hispanics are taking and 11 percent more are passing.

“Education determines economic destiny — at this moment in history more than ever before,” Mayor Bill de Blasio said at a news conference at a Queens high school after he dropped in on an AP literature discussion of the English novelist Virginia Woolf.

“But if AP courses were given to some, and not others, we were literally closing the doors of economic opportunity,” he said. “Today that ends.”

Advanced Placement courses and exams offer high schoolers the opportunity to study and earn credit for college-level coursework on more than three-dozen subjects, including calculus, art history, biology and Latin.

The city considers a score of 3 or higher on the 1-to-5 scale to be passing, although some colleges require 4s or 5s. The higher the score, the more likely it is that a college will grant credit, permit a student to skip introductory coursework and enroll in higher-level classes.

In Nassau and Suffolk counties, according to an analysis published in Newsday last year, there were 73,472 AP exams administered the prior spring in public schools, up by about 2.8 percent from 2015 and 31 percent from 2009. There are about 446,000 public school students on Long Island, compared with about 1.1 million in the city.

One of de Blasio’s most vocal critics on education, Jeremiah Kittredge of the pro-charter-school Families for Excellent Schools, said “expanding access to AP courses is a worthy cause.”

But Kittredge called the administration’s announcement “yet another example of the de Blasio administration tinkering at the margins instead of truly addressing the crisis in our schools.”

According to Kittredge, at 98 schools enrolling more than 33,000 students, none passed one AP exam in 2016.

Under the city’s AP for All initiative, all high schoolers will have the option to take at least five such courses by fall 2021.