A senior adviser to the US presidential hopeful John McCain has apologised after saying a terrorist attack on American soil would be a "big advantage" to the Republican candidate's election campaign.

Charlie Black later expressed regret over his "inappropriate" comments, and McCain said he disagreed with the claim.

McCain's presidential rival Barack Obama called the remark a "complete disgrace".

Discussing national security in an interview with Fortune magazine, Black was asked about the impact that another terrorist attack on US soil might have on McCain's campaign.

"Certainly it would be a big advantage to him," said Black.

He said the assassination of the former Pakistani prime minister Benazir Bhutto in December was an "unfortunate event" but had helped McCain to win the New Hampshire primary, a state he had to win to save his candidacy.

"His knowledge and ability to talk about it reemphasised that this is the guy who's ready to be commander in chief. And it helped us," said Black.

Asked about Black's comments at a press conference in California, McCain said: "I cannot imagine why he would say it. It's not true. I've worked tirelessly since 9/11 to prevent another attack on the United States of America. My record is very clear."

Black, who was travelling with McCain, said: "I deeply regret the comments. They were inappropriate. I recognise that John McCain has devoted his entire adult life to protecting his country and placing its security before every other consideration."

Bill Burton, Obama's spokesman, said: "The fact that John McCain's top adviser says that a terrorist attack on American soil would be a 'big advantage' for their political campaign is a complete disgrace, and is exactly the kind of politics that needs to change."

National security is seen as an issue on which McCain, who was held as a prisoner of war in Vietnam, has an advantage over Obama in the election. Republicans have sought to emphasise Obama's lack of experience and criticised the presumptive Democratic nominee when he suggested he would meet the Iranian president, Mahmoud Ahmadinejad. He later backtracked.

Black was an aide to the former presidents Ronald Reagan and George Bush Snr, and has advised the incumbent in the White House. Democrats have criticised Black's role in McCain's campaign as inconsistent with the Vietnam veteran's no-lobbyist policy. Black has represented a number of foreign governments in the US, including regimes with poor human rights records.