He must think he’s going to live forever.

An unrepentant thug convicted of nearly killing four NYPD cops smugly grinned as he was sentenced Thursday to 110 years to life behind bars for the wild shootout.

Nakwon Foxworth also sneered at three Emergency Services Unit detectives he fired upon on Easter Sunday 2012, who sat among two dozen other cops in the Brooklyn Supreme courtroom for the sentencing.

But he showed no remorse.

“I just want to apologize to my family for the pain and stress they’re going through,” the career criminal mumbled.

Then, in a boast full of hot air, he said: “I’ll be back.”

Judge Neil Firetog sentenced him to 25 to life on two counts of aggravated assault and 20 to life on three counts of attempted aggravated assault, all to run consecutively.

He also received 20 to life on multiple counts of criminal possession of a weapon and one year on a menacing charge.

The terrifying chain of events began when Foxworth, 36, became furious with movers at his Sheepshead Bay apartment building, as he, his pregnant girlfriend and their stroller-bound baby arrived home.

The mad man pulled a gun on one of the movers and threatened him, before retreating to his sixth-floor apartment to barricade himself, his girlfriend and the child and load a cache of weapons in anticipation of a police shootout.

He’d texted a friend prior to opening fire on the five ESU cops: “Yo homie I ain’t going back behind that wall man. F— this.”

Injured in the firefight were Dets. Kenneth Ayala, Michael Keenan, Matthew Granahan and Capt. Al Pizzano, who was not in court Thursday.

The officers all miraculously survived thanks to Ayala — who took bullets to the thigh and ankle but fiercely held onto the cops’ bulletproof shield to protect them.

Ayala thanked the judge before leaving.

Last month, Foxworth told a courtroom full of cops to “suck my d—k” as he was convicted of aggravated assault, attempted aggravated assault and other related charges but acquitted of multiple counts of attempted murder.

Speaking on behalf of the detectives, Paul DiGiacomo, vice president of the Detectives’ Endowment Association, said Foxworth’s punishment was fitting and that the “menace” needed to be off the streets.

“He’ll spend the rest of his life in prison. He’s where he belongs – in a cage,” DiGiacomo said. “If he continued to be on the street, he would’ve continued this criminal behavior.”

Foxworth’s attorney Damien Brown, who argued during the trial that cops shot first, said he plans to appeal.

“His life was turned around [because of the shooting]. He’s still a human being, he believes he acted in self-defense,” Brown told the judge.