Details on What Happened When a Cop Cheated on His Cop Girlfriend With Another Cop Whose Husband is Also a Cop and How All The Nudes Were Leaked on IG (Photos-Punishments)

Four New York Police Department officers are returning to work after a sordid love rectangle involving leaked nudes and social media made it to top-ranking officials and the involved parties had their work armor confiscated.

The New York Post reports that an NYPD sergeant cheated on his cop girlfriend with a fellow officer, whose husband is also on the job and when the mess became public, departmental leads took their guns away to keep them from killing each other.

Sgt. Kandou Worley, 40, and Officer Stephanie Gallardo, 33, were both assigned to the department’s Strategic Response Group when they had their fling last year, according to an internal NYPD document.

But their secret was revealed when Worley’s live-in girlfriend, Tyeis Coppin, a union delegate in the 32nd Precinct, found incriminating photos on his cellphone.

In a fit of vengeance, Coppin, 41, allegedly posted the photos to Worley’s Instagram account, which bears the username “mike_lowry_78” — an apparent reference to the ladies-man detective played by Will Smith in the “Bad Boys” movie franchise.

Captions say “I told my girl I loved her 10 mins b4 I f–ked this one,” and “She’s someone’s wife, she’s not my girl tho. I have one and this is not her!!!!”

On the day after Christmas, Worley — who a source said served as Gallardo’s supervisor — warned her that the photos were online, and the NYPD learned about them two days later.

Gallardo was called in for questioning, and admitted that she and Worley had a “personal relationship” during September and October.

But Gallardo said that she’d been separated from her husband, fellow SRG cop Cristian Gallardo, 28, since March, even though they’re still living together and raising their 20-month-old daughter.

She also claimed “that with the exception of kissing while together off-duty on a number of occasions, the relationship [with Worley] was not intimate.”

The NYPD report says a total of nine handguns were seized from all four cops under a section of the Patrol Guide that permits impounding firearms in “non-disciplinary cases,” including those involving “stress as a result of family or other situations.”

A law-enforcement source said the circumstances raised “the potential for violent outcomes due to the sensitive nature of infidelity and everyone having access to guns.”

Ultimately all four cops were returned to duty in their original positions but are still under investigation.

To see photos of those involved, flip the pages.