Drew Peterson (left) listens as his attorney Steve Greenberg questions retired judge Daniel Locallo (right) on the second day of a hearing at the Will County Courthouse in Joliet, Ill. (ASSOCIATED PRESS / Tom Gianni)

JOLIET, Ill. (AP) — Drew Peterson — the swaggering Chicago-area police officer who gained notoriety after his much-younger fourth wife vanished in 2007 — was sentenced to 38 years in prison on Thursday for murdering his third wife.

The sentence came moments after Peterson shocked the courtroom with a rare public outburst of anger as he proclaimed his innocence in the death of Kathleen Savio.

“I did not kill Kathleen!” he shouted at the top of his lungs, emphasizing every word.

Peterson seemed to look across the courtroom at Savio’s family. Savio’s sister Susan Doman shot back “Yes, you did. You liar!” before the judge ordered sheriff’s deputies to remove her from the courtroom.

Illinois does not have the death penalty, and the 59-year-old Peterson had faced a maximum 60-year prison term. The judge gave him four years’ credit for time he has served since his arrest.

Jurors convicted Peterson in September in Savio’s 2004 death. Neighbors found the 40-year-old’s body in a dry bathtub at home with a gash on her head — her hair soaked in blood.

Peterson is also a suspect in the disappearance of Stacy Peterson — who was 23-years-old when she vanished — but he hasn’t been charged in her case. It was her disappearance that led authorities to take another look at Savio’s death and eventually reclassify it from an accident to a homicide.

Fascination nationwide with Drew Peterson arose from speculation he sought to use his law enforcement expertise to get away with murder.

After his courtroom outburst, Peterson addressed the judge with a rambling speech, claiming he had been railroaded. He spoke in mostly hushed tones, crying and trying to regain his composure at times. His voice quivered and his hands were shaking as he reached out for a glass of water.

He aimed some of his anger at lead prosecutor James Glasgow, saying sarcastically that Glasgow could now celebrate because he had destroyed Peterson’s life.

“You perpetrated the largest railroad job ever in this country,” Peterson told him. Minutes later, Peterson challenged Glasgow to look him in the eyes. Glasgow, who had been taking notes, laid down his pen, folded his arms and looked straight back at Peterson.

Peterson had divorced Savio a year before her death. His motive for killing her, prosecutors said, was fear that a pending settlement would wipe him out financially.

“We all got an opportunity to see a psychopath reveal himself in open court,” Glasgow told reporters after Thursday’s hearing as he called Peterson a “cold-blooded killer.”

Before Thursday, Peterson had never publicly showed concern about the serious charges and the possible sentence he faced. The glib, cocky former police officer seemed to taunt authorities before his 2009 arrest, suggesting a “Win a Date With Drew Contest” and then, after his arrest, “Win a Conjugal Visit With Drew Contest.” More recently, his story inspired a TV movie starring Rob Lowe.

His personality loomed large over his trial, illustrated by crowds of bystanders gathered outside the courthouse in a circuslike atmosphere after his conviction last year, cheering as prosecutors walked by and shouting, “Loser. Loser. Loser,” at defense attorneys.

Savio’s family members told the judge Thursday that they hoped she was somehow watching the proceedings.

“I hope she is haunting him in his dreams,” said Henry Savio Jr., the victim’s brother. “I hope ... she is watching his descent into hell.”

Savio added his only consolation was that Peterson would be “rotting in prison for the rest of his life.”

The verdict was a vindication for Glasgow and his team, who gambled by putting on a case they conceded was filled with holes.

Prosecutors had no physical evidence tying Peterson to Savio’s death and no witnesses placing him at the scene. They were forced to rely on typically barred hearsay — statements Savio made to others before she died and that Stacy Peterson made before she vanished. Illinois passed a hearsay law in 2008 tailored to Drew Peterson’s case, dubbed “Drew’s Law,” which assisted in making some of the evidence admissible at Peterson’s trial.

The hearsay — any information reported by a witness not based on the witness’ direct knowledge — included a friend testifying that Savio told her Peterson once put a knife to her throat and warned her, “I could kill you and make it look like an accident.”

A turning point at the trial came when the defense called a divorce attorney who said he spoke to Stacy Peterson before she vanished. Rather than blunting her credibility, the witness stressed to jurors that Stacy Peterson seemed to truly believe her husband killed Savio.

Earlier Thursday, Judge Edward Burmila denied a defense request to grant Drew Peterson a retrial. Peterson’s current attorneys contended his former lead attorney, Joel Brodsky, botched the initial trial and had been the one to decide to call Smith to the stand. Brodsky stepped down from the defense team in November, as his quarrel with Peterson’s current lawyers worsened.

Prosecutors suspect Peterson killed his sandy-haired fourth wife because she could finger him for Savio’s death, but her body has never been found and no charges have ever been filed. Jurors weren’t supposed to link her disappearance to Savio’s death, and prosecutors were prohibited from mentioning the subject.

Peterson has maintained his fourth wife ran off with another man and is still alive.

Peterson’s attorneys have said they might appeal all the way to the U.S. Supreme Court on grounds Illinois’ hearsay law is unconstitutional.