Richard (Bo) Dietl and Bernard Kerik have long been familiar figures in the flashy underside of New York City night life. They could be seen swaggering into Rao's, an exclusive Italian restaurant in Harlem, where mobsters and models and Wall Street masters of the universe drink shots and swap boasts. Both men were up-from-nothing tough guys, former cops who now wore silk-threaded suits and thin-soled loafers. Sometimes Bo and Bernie were buddies, sometimes not. Lately they have been friends again. Bo is in the security business; Bernie had just been nominated as secretary of Homeland Security by President Bush. Never know when a friend might come in handy.

So Dietl had taken to the airwaves, talking up what a great stand-up guy Bernie Kerik was on "Imus in the Morning" and CNBC's "Kudlow and Cramer." His friend Kerik called to thank him for the kind words, but he seemed worried. "A lot of people are trying to f--- with me," Kerik said, as Dietl recalls.

Apparently so. Within three days, Kerik was done for, compelled to withdraw his name as Homeland Security czar. For the record, the proximate cause was a nanny problem: in going over his financial records, Kerik informed the White House, he had discovered that his housekeeper/nanny appeared to be an illegal immigrant and that he had failed to pay all the necessary taxes for her. Since the Homeland Security Department runs the U.S. immigration agencies, it wouldn't do to have the secretary employing illegal aliens.

But few Washington or New York insiders believed that Kerik's problems stopped there. On his way up, Kerik had shown an inclination to make his own rules, and he had made some powerful enemies. The very qualities that appealed to President Bush--a willingness to get things done, and damn the naysayers--were bound to come back to haunt Kerik, especially in the equally vicious worlds of the New York glitterati and the Washington bureaucracy.

Consider, for instance, Kerik's relationship with Judith Regan. A flamboyant, stiletto-heeled--and highly successful--book publisher, Regan published Kerik's sensational memoir, which begins with the scene of Kerik's mother, a prostitute, murdered in her pimp's bed. Occasional workout partners, Kerik and Regan became close friends. But their relationship soured, and Regan told friends Kerik had hounded her, and that she hired a bodyguard. Kerik's lawyer confirmed that Regan and Kerik were friends, but says "there was nothing untoward about their relationship." The lawyer called the allegation that Kerik had hounded her "absurd."

Regan declined to comment. She also told NEWSWEEK she had never been questioned by the White House or FBI when Kerik was being considered for the Homeland Security job over the past month. White House officials are defensive about the vetting process. They say they depended on Kerik to be forthcoming, and he failed to warn them of the nanny problem. (Kerik claims he himself was unaware of the problem until last week.) But some administration officials acknowledge that the president's predilections work against a careful review. Bush hates leaks and enjoys popping surprise announcements on the press. He liked the idea of Kerik--the self-made tough guy--and he dismissed as gossip or press carping newspaper stories about Kerik's bending the rules.

The White House seemed to shrug off stories of Kerik's financial dealings a little too easily, like the $6 million he made--without investing a penny--by cashing in his stock options in a company that made stun guns sold to the government. Then there was the arrest warrant. In 1998, Kerik was sued for failing to pay about $5,000 in maintenance fees on a condo he owned in New Jersey. When Kerik failed to respond to a subpoena, NEWSWEEK learned, a judge issued a warrant for his arrest. A Kerik spokesman later said Kerik paid the fees and the warrant was withdrawn, but the existence of the warrant was news to the White House and Kerik's handlers.

Kerik's somewhat cavalier attitude is best captured by his time in Iraq. After the invasion in the spring of 2003, Kerik was sent to Baghdad to organize the Iraqi police. But Kerik didn't seem to show much interest in Iraqis, said a senior U.S. official who worked with him. He appeared to enjoy going on night raids against "bad guys" with some South African mercenaries who were serving as bodyguards to U.S. officials. On his screen saver, Kerik had a photo of a big house he had just bought in New Jersey that he said was across the street from former New York Giants quarterback Phil Simms's. Kerik told his colleagues he planned to be in Baghdad for three months while the house was undergoing renovations. "So," the official says he told Kerik, "you're here because you needed a place to go while they're doing renovations on your house." Kerik grinned and cocked a finger as if to say, "You got it." A spokesman for Kerik said that story was "absurd" and that Kerik was a patriot.