More than 640 officers graduated the Police Academy on Thursday, as the NYPD continues to focus on diversity in its graduating classes.

The 646 officers, who celebrated amid falling blue and white confetti at the Theater at Madison Square Garden, represented 39 countries and spoke 53 different languages, Mayor Bill de Blasio said.

Of those graduating, 21% were born outside of the U.S. and 22% were women.

About 16% were African American, 29.5% Hispanic and 11.9% Asian, said Benjamin Tucker, the first deputy commissioner.

“You are people from every part of the globe,” de Blasio said, speaking to the graduating class. “You represent all that’s good about New York City.

“This class is extraordinary in that it truly reflects every corner, every neighborhood of our city, all the peoples who make up the greatest city in the world,” he added.

Police Commissioner James O’Neill said increasing the department’s diversity has been a goal, and will go a long way in bringing police and the community closer.

“I think that’s something that the NYPD worked really hard at ... that we have a true representation of the city. And we’re getting closer and closer to that,” he said. “It’s important that people in this city see a police department that reflects the diversity of the city.

“In anything that we’re doing, we’re building up the trust between the police and the community,” O’Neill added. “And I think when we have that diversity, it’s going to happen.”