Rudy Giuliani's bid to become Republican candidate for US president faces months of questioning on the campaign trail, after his friend and protege Bernard Kerik was yesterday charged with corruption and lying to cover-up his misdeeds.

Mr Giuliani, the former mayor of New York, faces embarrassment in connection with his long-term friend who stands accused of a corrupt relationship with a firm linked to the mob. Mr Giuliani appointed Mr Kerik in 2000 to be New York police commissioner, and also put his name forward in 2004 to be head of the department of homeland security.

President George Bush followed the advice and nominated him for the position, but Mr Kerik withdrew when irregularities emerged over the tax affairs of his nanny.

Further allegations followed, culminating in yesterday's federal indictment. Mr Kerik is charged with accepting $165,000 (£79,000) in renovations to his Bronx apartment which were carried out by a construction company with alleged links to the New York mafia.

Michael Garcia, speaking for the federal government, alleged Mr Kerik lobbied city officials on behalf of the firm while accepting secret payments. This was "in effect selling his office in violation of his duty to the people of this city".

Mr Kerik pleaded not guilty to the charges. "This is a battle; I'm going to fight," he said. But his position is weakened by the fact that he admitted before a lesser court that the improvements to his flat did amount to an illegal gift.

Mr Giuliani's competitors for the Republican nomination seized upon the case. John McCain, senator for Arizona, said "I never would have supported [Mr Kerik] to be the head of homeland security." Mitt Romney, former governor of Massachusetts, questioned Mr Giuliani's ethical stance.Mr Giuliani is the front-runner but the competition is fluid and his poll ratings in the crucial early states of Iowa and New Hampshire are less than commanding. Some observers believe the scandal could be fatal for him.

"I think this is one of the stories that could bring down the whole edifice of his candidacy," said David Johnson, a Republican pollster and strategist. "Kerik reinforces the image of Republican corruption and the opinion that Giuliani likes to surround himself with yes-men."

Mr Giuliani has tried to distance himself from his friend in recent days, conceding that he was wrong to have proposed him as homeland security chief.

Mr Kerik faces up to 142 years in prison and a fine of $4.75m if he is convicted.