A Brooklyn man was convicted Wednesday of shooting three NYPD cops — and he sent a final insult to a half-dozen cops gathered in the courtroom when he turned and hissed, “Suck my d–k,” before being led away in handcuffs.

Nakwon Foxworth, 33, was convicted on multiple counts of assault on a police officer for shooting and wounding the Emergency Service Unit cops when he barricaded himself inside his Sheepshead Bay apartment on Easter Sunday 2012.

As the Brooklyn Supreme Court jury was led out of the courtroom late Wednesday night, Foxworth turned and spat the vulgar insult at the detectives and cops in the courtroom.

A detective seated in the gallery silently returned the sentiment, cockily gesturing to his own crotch as court officers snapped handcuffs onto Foxworth. “Suck my d–k,” Foxworth repeated before court officers led him out.

“We wouldn’t expect anything more from him,” said a detective. “He can’t behave in the courtroom. Can you imagine him out on the street?” He faces life in jail.

The ex-con was convicted on the strength of incriminating text messages he sent to his pal before the shooting.

“Yo homie I ain’t going back behind that wall man. F–k this,” Foxworth texted a buddy before shooting the cops, prosecutor Andres Palacio said in his opening statement.

Jurors and Foxworth defense attorney Damien Brown declined comment outside court.

Foxworth was also convicted on illegal gun raps but was acquitted of multiple attempted murder raps.

“We’re disappointed in not getting the guilty verdict on the attempted murder charges and we hope the judge will put this person away for the rest of his life because he’s a menace to society and a danger to the people who protect this city,” said Det. Paul DiGiacomo, vice president of the Detectives’ Endowment Association.

Foxworth was released from jail in 2009 after doing 10 years for weapons and drugs. He also did two years behind bar for attempted murder as a juvenile.