It showed Mr McCain, a pilot who spent five years in a Vietnamese PoW camp, walking through the cemetery, which is reserved for US servicemen. This week the Army confirmed he had not asked to film at the cemetery and if he had, permission would not have been given, because party political activity is forbidden at army installations.
In a letter to the army, Mr McCain said his campaign had been in error in not asking permission and promised the footage would be excised. The advert was his first and so far only television plug; the new version is expected to be released within days.
The episode embarrassed Mr McCain, who is trading on his war record to illustrate his leadership qualities as he campaigns against the Republican front-runner, the Governor of Texas, George W. Bush. Mr Bush did not go to Vietnam and volunteered for the Texas National Guard rather than face conscription.
A poll yesterday showed Mr McCain neck-and-neck with Mr Bush in New Hampshire. Nationally, Mr Bush has a 30-point lead over Mr McCain, his closest challenger.
The Bush campaign recognises Mr McCain's appeal and is treating his campaign with caution. Mr Bush said: "If I had to guess why Mr McCain is doing so well in New Hampshire, I'd say it is because people respect him ... He is a war hero." Mr Bush said he would make a better commander- in-chief of US forces, "because I've had chief-executive experience ... I know how to rally people." To which Mr McCain's spokesman responded: "We'll let the voters decide."