Nearly 1,200 new NYPD officers, representing the first group of new hires authorized by City Hall earlier this year to boost the police department’s ranks, were sworn in Tuesday during a ceremony at Madison Square Garden where police and city leaders underscored for graduates the terrorism threat they’ll face.

The newly minted officers sat still, wearing hats, white gloves and dress blue uniforms as Mayor Bill de Blasio and NYPD commissioner William Bratton wished them well in a world facing new challenges from crime, disorder and global terrorism.

“You are coming into this profession at a time of extraordinary challenge, extraordinary change, and you are the change agents, you are the beginning of the transformation of American policing, you are the beginning of the transformation of the NYPD,” Police Commissioner William Bratton told the police academy graduates.

See alsoMajor NYC crime

They are the “ultimate public servants,” charged with preserving the peace and protecting the public while putting their lives on the line, said U.S. Secretary of Homeland Security Jeh Johnson in his address to the class.

Fourteen years after the Sept. 11, 2001 terror attacks, the world remains a dangerous place, Johnson said.

But the terrorist threat is very different now because extremist groups can inspire lone wolf attacks that a cop on the beat might be the first to detect, Johnson said.

advertisement | advertise on newsday

De Blasio noted that 95 members of the class had already served in the military.

“You represent people who deeply, deeply care about this city,” de Blasio told the officers. “You represent every community of this great city, you look like this city and you make us proud because you bring the best of New York City to this work.”

DeBlasio gave a shout out to three brothers from Staten Island — Alec, John and Stephen Favale — who graduated together, perhaps the first time in city history that has happened. They are the sons of NYPD deputy inspector Anthony Favale and Stephanie Favale.

“Talk about running in the family, and family tradition,” de Blasio said.

In June, the City Council authorized 1,300 additional officers, raising the authorized strength of the NYPD for the first time since early 2002 when there were about 41,000 cops.

Get the Newsday Now newsletter!

The best of Newsday every day in your inbox.

DeBlasio said the graduates represent a “new wave” of officers who will hit the streets at a time when the department is emphasizing neighborhood policing as a way of further driving down crime.

Bratton noted that the sworn-in officers numbered 1,123, with an additional 10 cops from the Metropolitan Transportation Authority and one from Abu Dhabi among the graduates.

Demographically, the class was composed of 46 percent white, 15 percent black, 26 percent Hispanic, 10 percent Asian officers. They can speak 64 different languages, Bratton added.

“You are a reflection of this great city,” said Bratton.