In December 2004, President Bush nominated Mr. Kerik, a former New York police commissioner, to head the federal Department of Homeland Security. Seven days later, Mr. Kerik withdrew as a nominee.

A cascade of questions followed about his judgment as a public official, not least that he had inappropriately lobbied city officials on behalf of Interstate Industrial, a construction firm suspected of links to organized crime. Mr. Giuliani defended Mr. Kerik, a friend and business partner, whom he had recommended to the Bush administration. But he also tried to shield himself from accusations that he had ignored Mr. Kerik’s failings.

Mr. Giuliani amended that statement last year in testimony to a state grand jury. He acknowledged that the city investigations commissioner, Edward J. Kuriansky, had told him that he had been briefed at least once. The former mayor said, though, that neither he nor any of his aides could recall being briefed about Mr. Kerik’s involvement with the company.

But a review of Mr. Kuriansky’s diaries, and investigators’ notes from a 2004 interview with him, now indicate that such a session indeed took place. What is more, Mr. Kuriansky also recalled briefing one of Mr. Giuliani’s closest aides, Dennison Young Jr., about Mr. Kerik’s entanglements with the company just days before the police appointment, according to the diaries he compiled at the time and his later recollection to the investigators.

The additional evidence raises questions not only about the precision of Mr. Giuliani’s recollection, but also about how a man who proclaims his ability to pick leaders came to overlook a jumble of disturbing information about Mr. Kerik, even as he pushed him for two crucial government positions.

“Rudy can fall for people big time, and sometimes qualifications are secondary to loyalty,” said Fran Reiter, a former Giuliani deputy mayor who now supports Hillary Clinton. “If he gets it in his head he trusts you, he is extremely loyal.”

Mr. Giuliani has routinely met loyalty with loyalty, standing by political allies and friends in their darkest hours. Giuliani Partners, for example, his consulting firm, employs a high school friend, Msgr. Alan Placa, despite allegations that he sexually molested young men years ago.

Mr. Giuliani has said he believes in his friend, who has denied the allegations and was not criminally charged.

In Mr. Kerik’s case, by the time Mr. Giuliani recommended him for the federal job, his administration knew that Mr. Kerik had acted on behalf of Interstate Industrial. It also knew that he had drawn criticism for a range of other incidents, from sending detectives to search for his lover’s cellphone to using officers to research his autobiography.

Mr. Kerik, who declined to speak about his troubles, now faces possible indictment on a range of federal felony charges, including perhaps tax evasion and bribery, stemming in part from his acceptance of $165,000 in renovations to his Bronx apartment paid for by Interstate. In June 2006, he pleaded guilty in the Bronx to state misdemeanor charges relating to the same renovations.

Though Mr. Giuliani’s rivals for the Republican presidential nomination have not made an issue of Mr. Kerik, his indictment could be a major embarrassment for Mr. Giuliani.

Mr. Giuliani, who also declined to comment, still vigorously defends Mr. Kerik’s performance as police commissioner. He told the grand jury that Mr. Kuriansky concluded that nothing in Mr. Kerik’s background, including his ties to Interstate, precluded his appointment as police commissioner.

But Mr. Giuliani now acknowledges that he should have re-examined his friend before recommending him to the White House and that his recommendation had indeed been a mistake.

In 2000, more than half the mayor’s cabinet had opposed Mr. Kerik’s appointment to be police commissioner. His detractors had noted, among other concerns, that Mr. Kerik did not have a college degree, a department requirement at the time for captains and above.

Photo

Bernard Kerik arranged a meeting at City Hall in 1997 that included his friend Lawrence Ray, Rudolph Giuliani and Mikhail Gorbachev, the former Soviet leader.Credit
Don Hogan Charles/The New York Times

Mr. Giuliani waved off the dissenters. “I believe that the skill I have developed better than any other was surrounding myself with great people,” Mr. Giuliani wrote in his 2002 book, “Leadership.”

“Too many leaders overlook candidates with unusual résumés because of a failure of nerve,” Mr. Giuliani wrote. “By the time I appointed Bernie Kerik, I had hired so many people that I was immune to such criticisms.”

Tapped for Power

The men who would become patron and protégé first met at a fund-raiser in 1990 in New Jersey honoring a slain New York City police officer.

Mr. Kerik was a comic book hero come to life, a decorated undercover detective with a ponytail and earrings, thick biceps and a taste for four-letter words as nouns, verbs and adjectives. He cultivated relationships with powerful people, including an influential sheriff who five years earlier had made him the youngest jail warden in the history of Passaic County, N.J.

When Mr. Giuliani ran for mayor in 1993, Mr. Kerik organized his security detail of off-duty officers, reserving the weekend shift for himself.

When Mr. Giuliani became mayor, he gave Mr. Kerik a job in the Correction Department. A year later, the mayor asked him to drop by Gracie Mansion.

The two men sat upstairs and shared a bottle of red wine, a gift to the mayor from Nelson Mandela. Mr. Giuliani said he planned to appoint Mr. Kerik as first deputy correction commissioner.

Mr. Kerik, who wrote of this in his autobiography, “The Lost Son,” was taken aback; he was a year removed from being a police detective.

“Mayor, I appreciate your confidence in me, I really do,” he said. “But I ran a jail. One jail. Rikers is like 10 jails.”

Just do it, the mayor replied.

Mr. Kerik followed Mr. Giuliani downstairs to a dimly lighted room. There waited Mr. Giuliani’s boyhood chum Peter J. Powers, who was first deputy mayor, and other aides. One by one, they pulled Mr. Kerik close and kissed his cheek.

“I wonder if he noticed how much becoming part of his team resembled becoming part of a mafia family,” Mr. Kerik wrote. “I was being made.”

Mr. Kerik was named correction commissioner in 1997. He brooked no slacking. He startled sleepy wardens by walking cellblocks at 2 a.m. Violence plummeted, and he basked in good press.

Behind the scenes Mr. Kerik ruled like a feudal lord, many former employees have said. He had taken up with a woman who was a correction officer; he was accused of directing officers to staff his wedding. He befriended the agency’s inspector general, whose watchdog responsibilities require keeping an arm’s-length relationship, and the investigator attended his wedding.

As the years passed, one of his top deputies was convicted of taking $142,000 from a Correction Department charity that Mr. Kerik headed. Another deputy, Anthony S. Serra, became a warden at Rikers Island even after he was accused of coercing officers to work on Republican campaigns. He was later convicted of forcing staff members to do campaign work and dispatching officers to renovate his upstate home.

Building Suspect Ties

Mr. Kerik earned $150,500 as commissioner but pleaded poverty. He turned to Lawrence V. Ray, a friend of a few years, who had an engaging manner and a big bankroll.

In 1998, Mr. Ray was the best man at Mr. Kerik’s wedding — and paid for much of the event. Weeks later, Mr. Kerik recommended Mr. Ray for a $100,000 job with Interstate Industrial Corporation, a New Jersey-based construction firm with tens of millions of dollars in city contracts.

Two years earlier, the owners, Peter and Frank DiTommaso, had paid more than $1 million to buy a transfer station from Edward Garafola, a mob soldier, and hoped to obtain a city operating license. But city investigators had found that the company employed mob figures and used mob-controlled trucking firms.

The DiTommasos, who adamantly and repeatedly have denied any ties to organized crime, hoped Mr. Ray could help resolve their problem with the Giuliani administration. Soon after being hired, Mr. Ray took Frank DiTommaso to meet with his friend the correction commissioner.

Photo

After leaving office, Mr. Kerik campaigned for President Bush at an event in Marlton, N.J., in October 2004.Credit
Larry Downing/Reuters

Mr. DiTommaso recalled the moment for city investigators: “Mr. Ray walked into the office, unannounced, just walked right in; Mr. Kerik got up and came around the desk and give him a big hug and a kiss.”

Within months, Interstate had hired Mr. Kerik’s brother and the commissioner had begun lobbying behind the scenes for Interstate.

One night in July 1999, he sat in Walker’s, a bar in downtown Manhattan, defending Interstate to Raymond V. Casey, a cousin of Mayor Giuliani who was chief of enforcement for the city commission that was reviewing Interstate’s license application. Later that year Mr. Kerik telephoned an assistant commissioner at the Department of Investigation to say that Interstate’s owners, as far as he knew, were clean of mob taint, according to a person familiar with her account.

An error has occurred. Please try again later.

You are already subscribed to this email.

And that September he had city detectives investigating the company meet Mr. Ray in his city office, a location that underlined for the men that the company had powerful friends.

The lobbying stopped on March 2, 2000, when Mr. Ray and Mr. Garafola, the mob soldier, were indicted on federal charges in an unrelated stock scheme. Top Giuliani officials suspended Interstate’s $85 million in city contracts.

Three weeks later, Mr. Kerik sat down for a nearly two-hour interview with top officials at the Department of Investigation. He talked about his relationship with Mr. Ray and the DiTommasos, about the hiring of his brother and the meeting at Walker’s.

He neglected to mention a key fact: Interstate was paying for $165,000 worth of renovations on his new apartment in the Bronx.

Vetting Giuliani’s Choice

That July, Police Commissioner Howard Safir said he intended to resign. Mr. Giuliani narrowed the field of candidates to two: Chief of Department Joseph P. Dunne and Mr. Kerik, the correction commissioner, who had spent eight years as a police officer.

Mr. Kuriansky, the investigation commissioner, oversaw the background checks. The agency is designed to be semi-independent, but Mr. Giuliani had torn down that wall, senior investigators said, appointing friends like Mr. Kuriansky as commissioner and having them attend his morning meetings.

Mr. Kuriansky, a former special prosecutor, knew that Mr. Kerik had intervened on behalf of a firm suspected of mob ties and that the commissioner’s brother and best friend worked for the company.

But he did not know that Interstate had paid to renovate Mr. Kerik’s apartment. And records indicate Mr. Kuriansky did not think the known record was enough to disqualify Mr. Kerik.

On July 27 that year, according to Mr. Kuriansky’s diaries and his later recollection, he briefed the mayor and Mr. Young, Mr. Giuliani’s close aide, on Mr. Kerik’s relationship with Mr. Ray and Interstate.

Handwritten notes, taken by a city investigator during a December 2004 interview with Mr. Kuriansky, described his recollection: “Meet with RG & DY, discuss BK background review, Ray issue.”

Mr. Kuriansky’s diaries say he conducted a similar briefing for Mr. Young on Aug. 14, 2000, five days before Mr. Kerik’s appointment. Later, in his conversation with city investigators, Mr. Kuriansky summed up what he had related to Mr. Young: “Ray connection to BK, Ray was best man, brother worked at IS - all reported to DY.”

Mr. Young, through a spokeswoman, declined to be interviewed.

Last year before the grand jury, Mr. Giuliani said that he recalled receiving a briefing on Mr. Kerik’s background, but that neither he nor his aides remembered delving into Interstate or Mr. Ray. Even Mr. Kuriansky had trouble recalling the briefings, he said.

Mr. Kuriansky died in July. He refused numerous interview requests before his death and never explained why he did not seem more troubled by Mr. Kerik’s entanglements with Interstate, which seem to violate city conflict of interest rules.

On Aug. 19, 2000, Mr. Giuliani decided the job was Mr. Kerik’s, saying that he saw a fiercely loyal man with natural leadership ability. One Giuliani aide who attended some of the meetings on the choice said he never knew of Mr. Kuriansky’s findings and does not believe the mayor would have overlooked such a problem.

“Had any of us known of Bernie’s relationship to Interstate, it would have demolished him as a candidate,” said the former official. “It’s kind of mind-boggling.”

Photo

Bernard Kerik last year outside court in the Bronx, where he pleaded guilty to having free work done on his apartment.Credit
Librado Romero/The New York Times

Trouble at the Helm

Mr. Kerik’s 16-month tenure as police commissioner generally drew plaudits. Crime fell, relations with black leaders improved and Mr. Kerik’s ties to Mr. Giuliani grew tighter, to the point where he named the mayor the godfather of his daughter.

Behind the scenes, Mr. Kerik surrounded himself with police and correction buddies. When his book publisher and lover, Judith Regan, believed someone had stolen her cellphone and a piece of her jewelry, a Kerik aide dispatched elite homicide detectives to question suspects.

In researching his book, Mr. Kerik sent officers to investigate his mother’s death, an abuse for which the city’s Conflict of Interest Board later fined him $2,500.

None of the ethics problems seriously damaged Mr. Kerik, though, and when terrorists attacked the World Trade Center, Mr. Kerik won public acclaim, largely because he displayed steady resolve at Mr. Giuliani’s side.

Three years later, after his federal nomination was withdrawn, it was discovered that he had used an apartment originally set aside for weary rescue workers at ground zero as a nest for an extramarital affair with Ms. Regan.

After Mr. Giuliani left office in 2002, Mr. Kerik joined him at his new consulting firm, Giuliani Partners. In 2003, President Bush sent Mr. Kerik to Iraq to reorganize the Iraqi police force. In Baghdad, he signed autographs, surrounded himself with South African bodyguards, slept during the day and joined Iraqi paramilitary units on corruption raids late into the night. He decided to leave suddenly after three months.

He campaigned hard for President Bush’s re-election the next year, bonding with the president on the campaign trail and speaking at the Republican National Convention in New York.

After the election, Mr. Bush sought a director of homeland security. Mr. Giuliani was among the people who promoted Mr. Kerik for the job, and even helped him prepare for the interviews.

By this time, Mr. Kerik’s former warden, Mr. Serra, had been indicted. Another top aide, Frederick J. Patrick, had been sentenced to prison and had been told to reimburse $142,000 taken from the foundation he ran with Mr. Kerik. And newspapers had written of Mr. Kerik’s efforts to protect a correction aide accused of beating his lover.

But if Mr. Giuliani or Mr. Bush took notice, the issues did not give them pause.

“He was a champion of him,” Andrew Card, chief of staff to Mr. Bush at the time, recently recalled of Mr. Giuliani. “It wasn’t an arm-twisting session. It was more of a character reference.”

Mr. Kerik’s tenure as a nominee lasted one week. He withdrew when he and Mr. Giuliani said they discovered that his nanny was in the country illegally and that he had failed to pay taxes for her.

Worse news was coming. Newspapers reported that Mr. Kerik had accepted undisclosed cash gifts from Mr. Ray and lobbied for Interstate. At the time, Mr. Giuliani said he was not inclined to second-guess his choice of Mr. Kerik as police commissioner.

“Sometimes you look back on some of these choices and you made the wrong one,” he said. “In this case, he turned out to be the right one.”

Less than two years later, though, Mr. Giuliani would find himself being grilled about that choice. On April 20, 2006, before a state grand jury, a prosecutor in the Bronx district attorney’s office peppered Mr. Giuliani, one of the most powerful prosecutors in the late 20th century, about his apparent lack of memory.

Would you have considered it unusual and significant, the prosecutor asked, if as mayor in 2000 you had been told that a close friend of your correction commissioner had been indicted in a federal case with organized crime figures?

There was nothing hypothetical about the question. The prosecutor was merely laying out the facts established by the Department of Investigation in the months before Mr. Giuliani appointed Mr. Kerik police commissioner.

Yesterday, Mr. Kerik’s lawyer met with federal prosecutors in New York in an effort to stave off indictment. In a recent interview, Mr. Kerik said that he had been steering clear of Mr. Giuliani, lest his troubles hurt his friend, although they did cross paths at the Sept. 11 ceremony at ground zero this fall.

“We have not communicated in months, at all, at all,” he said. “When the last time is, I could not even tell you.”

Elisabeth Bumiller and Eric Lipton contributed reporting.

A version of this article appears in print on , on Page A1 of the New York edition with the headline: Loyal to Kerik, Giuliani Missed Warning Signs. Order Reprints|Today's Paper|Subscribe