The former concierge of a posh Boston building sexually threatened a prosecutor’s wife in court Tuesday — just hours before he was found guilty in the grisly 2017 slaying of two engaged doctors.

Bampumim Teixeira, 33, was yanked out of Suffolk Superior Court twice, the first time after he lashed out at Assistant District Attorney John Pappas during jury deliberations, local reports said.

“Yo Pappas, you better hope I never get out of jail, because if I do I’m going to f–k your wife,” Teixeira said, launching into a stream of expletives as officials dragged him away, according to video from 7 News Boston.

Then, moments before the verdict was read, Teixeira turned to the sobbing families of the victims and asked: “Do you want to know his last words?”

The judge refused to allow Teixeira back inside the courtroom after his second outburst.

Teixeira was convicted of first-degree murder in the vicious May 5, 2017, stabbings of Dr. Richard Field, 49, and his fiancee, Dr. Lina Bolanos, 38, inside their South Boston penthouse.

Police found the couple with their throats slashed and their hands tied behind their backs, lying in pools of their own blood.

A friend of Fields had received a text from his phone saying a gunman was in the apartment and called the cops.

Officers found Teixeira still inside the apartment, and shot him. They found a BB gun, knives, masks, handcuffs and duct tape.

Teixeira, homeless and a convicted felon, for three weeks in 2016 had been a concierge at the building where the anesthesiologists lived. He was also found guilty of home invasion, armed robbery and kidnapping.

He is set to be sentenced Friday.

Suffolk District Attorney Rachael Rollins said her staff was looking at charging Teixeira for the court outbursts, the Boston Herald reported.

Pappas said Teixeira’s threats “just reaffirmed that we have had the right person all along, and he really exposed what his intent was.”

Prosecutors said Teixeira used his knowledge of the building to break in so he could rob and kill the couple.

Teixeira claimed he’d been having an affair with Bolanos and that Fields stabbed his fiancee to death after walking in on them. He then said he had to kill Fields in self-defense.

Pappas blasted that defense as “utterly absurd and ridiculous.”

“It was not enough for him to murder them in their own home,’’ Pappas said of Teixeira’s account.

“Not enough for him to destroy their lives … He had to destroy their names as well.”