Convicted cop killer Betsy Ramos just completed a 20-year prison stint for the 1998 line-of-duty killing of NYPD Officer Anthony Mosomillo — and now she’s headed back for another two-year stay behind bars.

Brooklyn Federal Judge Nicholas Garaufis handed down the maximum sentence he could give Ramos, 55, on Friday for an old probation violation after an emotional two-hour hearing attended by Mosomillo’s family and fellow officers.

Ramos was on supervised release for an old drug charge when she was convicted of manslaughter for aiding her abusive boyfriend just before he shot and killed Mosomillo on May 26, 1998.

Ramos’ role in Mosomillo’s death was considered a violation of supervised release, but that matter was put on hold while she did time for manslaughter up until she was released from state custody on Dec. 10.

“By lying to the police about the whereabouts of someone who she knows is a dangerous person she placed two brave police officers in danger,” Garaufis said.

Garaufis noted that Ramos had a lengthy criminal history before meeting Jose Serrano, the boyfriend who killed Mosomillo. He also said that Ramos apparently has a “defiance for authority” — he said that, during her 10-day stay at the Metropolitan Detention Center leading up to the sentencing hearing on Friday, she got into an argument with a corrections officer over making her bed.

Garaufis said he took the incident into account when he considered her sentence, as it raises questions as to whether or not she can “respect the law” if she is released.

“What does it take to fix your bed?” Garaufis said to Ramos. “You don’t have to be in prison to do it. What goes on in the mind of this defendant? She knows she’s being watched, being supervised, when she gets into an argument with some prison guard.”

Amanda Bashi, Ramos’ attorney, declined to comment after the sentencing. She had pushed to have Ramos released with time served, arguing that Ramos was under the spell of an abusive boyfriend when she participated in Mosomillo’s murder and that because she has cancer and HIV that she doesn’t have long to live.

Garaufis handed down the sentence after listening to harrowing victim impact testimony from Mosomillo’s brother and his widow before a room packed full of members of the Patrolmen’s Benevolent Association.

Miriam Torres, Mosomillo’s partner at the time of his death, also provided a statement — she recounted her and Mosomillo’s fateful meeting with Serrano and Ramos, her voice rising to a shout at times and occasionally jabbing her finger through the air at Ramos.

Torres said that, prior to the shoot-out in Ramos’ apartment, Ramos tried to prevent Torres from slapping cuffs on Serrano. She also said that Ramos helped Serrano remove Torres’ service weapon from her holster before Serrano used it to fire shots at Mosomillo.

Serrano shot Mosomillo dead at the scene and Mosomillo died later at Kings County Hospital.

To this day, Torres said at the hearing, she suffers from nerve damage from her fight with Serrano — as well as psychological issues and “survivor’s guilt” from Mosomillo’s death.

“That’s never going to go away. Never going to go away!” Torres shouted at Ramos. “And it’s because of you, you piece of s–t!”

Serrano was cleared on charges that she put her hand on Torres’ gun, but her account of the incident to parole commissioners shifted over time, court records show.