A cop once assigned to Mayor Bloomberg’s elite security detail was convicted of attempted murder yesterday for shooting his girlfriend’s ex-boyfriend outside her Queens apartment.

The sordid love triangle brought down the stellar career of Leopold McLean, 48, who was guarding Bloomberg’s daughter Georgina at a Knick game in November 2010 when he raced from Midtown to Armonk to Jamaica to protect his girlfriend from her stalking former beau.

Instead of dispatching a unit to Assia Winfield’s home, McLean took matters into his own hands, racing to Queens, then shooting LePaul Gammons, who was unarmed, as he fled.

“This is truly a sad day for everyone when a police officer is convicted of breaking the very laws he had sworn to uphold,” Queens District Attorney Richard Brown said of the 20-year veteran cop. “But in the pursuit of justice, nobody is above the law.”

Prosecutors said McLean lied about the shooting and tried to pretend he was responding to a burglary.

McLean called 911 to report a burglary to “cover up the shooting,” cleaned his gun and didn’t tell any cops that he fired his weapon, Queens assistant DA Carmencita Gutierrez said.

McLean told jurors he didn’t report the shooting out of fear that it would “bring attention” to him and his high-profile unit.

He said he didn’t know he had shot Gammons.

But the jury acquitted him of tampering with physical evidence and on two counts of falsely reporting an incident.

Cops found no sign of forced entry at the woman’s home.

Sporting a navy-blue suit and tie, McLean held his head down as the foreman read the verdict and his relatives shook their heads in disappointment.

McLean also was convicted of first- and second-degree reckless endangerment.

Gammons said McLean had threatened him once before with a gun, but an Internal Affairs investigation could not substantiate the claim.

McLean, who had been free on $10,000 bail since the Internal Affairs Bureau was alerted by Gammons of the shooting, was remanded by Queens Supreme Court Justice James P. Griffin. McLean was handcuffed and hauled off to Rikers Island — where Gammons currently is being held for a forgery conviction.

McLean is to be sentenced June 13 and faces up to 25 years in prison.

His lawyer, Stephen Worth, said there are “ample grounds to appeal the decision and we plan to do so.”

McLean had been placed on modified duty, pending the outcome of the criminal case, and will go through a departmental hearing to determine his NYPD status.

A portion of the shooting was captured on surveillance video. Gammons was shot along 119th Road as he ran toward Sutphin Boulevard

After the incident McLean was bounced from Bloomberg’s protection detail, suspended and stripped of his gun and badge.

Winfield, a personal trainer and fitness instructor, had a restraining order against Gammons when McLean allegedly shot him in the back and buttocks as he was running away on Nov 15, 2010 outside her house on 153rd St. in South Jamaica.