NYPD bosses have been throwing pizza parties for some of the city’s most hardened gang members — telling them they are loved and respected, in an effort to steer them from violence.

Criminals from rival crews, such as the Wave, the Very Crispy Gangsters and the Rock Stars, were assembled for two get-togethers hosted by police brass, with one attended by Chief of Department James O’Neill.

“Everybody here cares about you. Everybody here respects you,” the men were told, according to David Kennedy, a criminologist at John Jay College of Criminal Justice who came up with the idea.

“You are the people in this city who are at the absolute highest risk of getting hurt, getting killed, hurting somebody else and going to jail and prison.”

Kennedy said the aim of the program is to reduce violent crimes by reaching out to the “tiny minority” of city residents who commit them.

The pilot program, NYC Ceasefire, held its first event Dec. 3 at a Masonic temple in Fort Greene, Brooklyn.

The party drew about 16 gangsters, who feasted on cheese pizza as they heard from preachers, social workers, prosecutors and cops.

Some had been convicted of homicide, shootings, robberies and assaults.

Attendance was required as part of their parole or probation, sources said, and they were told how to earn a GED and get into drug-rehab and job programs.

They were warned that if they continued breaking the law, prosecutors would come down hard on them.

“I told them this was an opportunity to walk away from your lifestyle. And if you don’t, and you stay associated with your gang or crew, and a murder is committed, then we’re coming after everybody. You’re going to be responsible for your whole gang or crew’s actions,” O’Neill told The Post.

A second meeting was held March 4 with 22 thugs.

Not everyone is sold.

“Maybe we should just invite them all to Disney World so we can give them experience of a fantasy world,” a law-enforcement source cracked.

But Susan Herman, deputy commissioner for collaborative policing, said, “It’s worked all over the country, and it’s going to work here.”