The life of Bernard Kerik is a rags-to-riches-to-disgrace story, in which the son of a murdered prostitute rose to become one of the top lawmen in the nation, only to see his career and reputation wash away in a wave of scandals.

Born in Paterson, N.J., in 1956, Kerik grew up tough after his mother died when he was a toddler – bludgeoned to death, apparently by a pimp, in a seedy flophouse.

Raised by his machinist father, he earned a reputation for toughness as he took up karate and became a black belt. He didn’t get a high school diploma.

He would later get a GED, but first he entered the Army, where he worked as an MP. His martial skills – and his sharp sartorial style – caught the eye of a general, who assigned him to train Special Forces soldiers in karate.

After working as a New Jersey jail warden in the early 1980s, Kerik decided he wanted to join the NYPD. But at first, no one would take his calls, and he grew so frustrated that he wrote to then-Mayor Ed Koch, who sent him application forms.

He became an undercover drug cop and an advocate for the families of slain officers.

It was at a fund-raiser for this cause that he met then-U.S. Attorney Rudy Giuliani. They forged a relationship that led Kerik to the top.

After providing security during Giuliani’s campaign, Kerik was named to head the Department of Correction in 1993. He would get the NYPD Medal of Valor for reducing violence in jails.

Giuliani named Kerik police commissioner in 2000, even though, at the time, he didn’t even have a college degree.

After Giuliani left office, Kerik went to Baghdad to build the police force.

In December 2004, he was nominated to head the Department of Homeland Security by President Bush. It was supposed to be the crowing achievement of his career – but when investigators found he used an undocumented nanny for his two children, he stepped down, and a flood of other revelations surfaced.

Everything from questions about his sale of stock in a taser company to his alleged affairs with a fellow correction officer and New York mega-publisher Judith Regan became public fodder.

Eventually, his relationship with the mob-tainted Interstate Industrial Corp. came to light, and led to his guilty plea yesterday.