This time last week, John Kerry was pictured in a salute on the front of US newspapers, telling the nation that he was "reporting for duty".

Today, his political opponents are hoping to take the shine off his military record with allegations that he won his five medals by lies and subterfuge.

An advertisement broadcast last night in the swing states of Wisconsin, Ohio and West Virginia - where a few votes could make all the difference - featured veterans such as Larry Thurlow telling voters: "When the chips were down, you could not count on John Kerry."

Mr Thurlow was in Vietnam at the same time as the presidential candidate, but he was not one of the men who had served on his Mekong delta swiftboat. Mr Kerry describes them as his "band of brothers", and they portray him as a courageous fighter and hero.

Mr Kerry's supporters, who have made much of his service in contrast to that of George Bush - who was excused Vietnam duty to serve in the Texas National Air Guard - are alleging dirty tricks.

The advert is part of a coordinated campaign. A week on Sunday, a book called Unfit for Command: Swift Boat Veterans Speak Out Against John Kerry, will be published, co-authored by former swiftboat commander John O'Neill.

It alleges that the wounds Mr Kerry won his three purple heart medals for were not worthy of the awards and, in at least two cases, had been self-inflicted in order to get him off the battlefield.

It argues that for him to run for president with such a record while faulting his opponent's would "represent unbelievable hypocrisy and the truly bottom rung of human conduct".

The Republican senator John McCain, a Vietnam veteran, spoke out after the advert's screening to "deplore" the tactics. When he ran against Mr Bush for the Republican nomination in 2000, he had to fight off allegations that being a captive (he was held in solitary confinement for three years) was not as heroic as actively attacking the enemy. Yesterday, he called on the White House to condemn the "dishonest and dishonourable" commercial.

Mr Bush's spokesman, Scott McCellan, did not denounce the advert but the money that paid for it - so-called "soft money", which is collected by independent political funds known as 527s. These are not counted as the Bush or Kerry campaigns so long as they do not actively call on voters to elect either man. Criticising a candidate's record is, however, fair game.

Therefore, neither of the parties behind the advert are part of the Republican party or the Bush campaign. Swift Boat Veterans for Truth is a 527, and Regnery Press is a commercial (although politically committed) publishing company. However, a look at the people who connect the enterprises reveals them to be part of a rich partisan tapestry.

Mr O'Neill is the link between them. As well as being the book's co-author, he is a member of the Swift Boat Veterans for Truth steering committee. The group was set up with the help of Merrie Spaeth, the widow of Tex Lezar, who was Republican candidate for lieutenant governor of Texas in the same year that Mr Bush ran for governor. He was a partner of Mr O'Neill's at their Houston law firm.

Regnery, meanwhile, proclaims itself to be the leading conservative publisher in the US. Acquired by Republican donor Thomas Philips in 1993, it is a subsidiary of Eagle Publishing, which is using its flagship Human Events magazine to promote Unfit for Command and build up its subscription base and mailing lists.

Regnery publishes on any number of topics (from threats to marriage to a defence of assault rifles), but scored a number of hits in the Clinton years with titles such as the conservative columnist Ann Coulter's High Crimes and Misdemeanors: the case against Bill Clinton.

The most notorious - Gary Aldrich's Unlimited Access: an FBI agent inside the Clinton White House - depicted the executive mansion as a den of debauchery, drug-taking and gay sex. One section claimed the president was smuggled out under a rug for trysts with a female celebrity in a nearby hotel. Mr Aldrich admitted in the book that many of his allegations were, at best, second-hand.

On top of this, the O'Neill/Regnery axis has links going back to Richard Nixon. Also a swift boat commander in Vietnam, Mr O'Neill was hired by presidential aide Charles Colson in 1971 to discredit the recently returned Mr Kerry's campaign against the war. Mr Kerry reputedly beat him in a nationally televised debate on the Dick Cavett Show.

Sidney Blumenthal, a Guardian columnist and former adviser to Mr Clinton, said he saw nothing new in Mr O'Neill's book and the campaign mounted by Swift Boat Veterans for Truth. "It reeks of partisan dirty tricks, and the facts simply don't hold up at all. The intent is simply to dirty Kerry," he said. "They have been trying to do this for a long time. Regardless of whether it is false, they will put it out to see if it will hurt."

The truth of the allegations is disputed by the Kerry campaign, and contradicts the most authoritative account of his time in Vietnam, Douglas Brinkley's Tour of Duty. The author is director of the Eisenhower Centre for American Studies at New Orleans university, which specialises in military history.

But the truth does not matter - to confuse the issue of Mr Kerry's military service, which he has made such a strong part of his campaign, is enough to occupy the candidate, distract him and muddy his record.

It is not the first time dirty tricks have surfaced in the 2004 campaign. The Drudge Report (which has served as a conduit for the allegations over Mr Kerry's Vietnam service, including allegations that he slaughtered livestock and burned down a village with a Zippo lighter) ran reports in February that the Massachusetts senator had an affair with an intern. There was no truth in it.

Later, a photograph emerged of Mr Kerry at a rally with Jane Fonda, the actress who visited Hanoi during the war and, to some, will forever be known as Hanoi Jane. It was proven to be a fake.

"In all this campaign, attacking Kerry on his Vietnam heroism has always backfired," Mr Blumenthal commented.

"It is particularly ironic and dangerous, given the fact that Bush is withholding national service records that that show he did not show up for duty in the Alabama national guard, and that he has still not come clean about why he was suspended from flying in the Texas air national guard after refusing to take a physical."

Of course, Democrats are not the only victims of dirty tricks. The emergence of documents detailing Mr Bush's arrest for drink-driving a few days before the last presidential election was blamed in some quarters for the closeness of the result and his failure to win the popular vote.

Around the time of the Kerry intern allegations, the Republican national committee chairman, Ed Gillespie, expressed outrage that the musician Moby, a Kerry supporter, had told the New York Daily News it would be possible to spread anti-Bush gossip on the internet to bring down his support among, for example, anti-abortionists.

He then turned it into a pre-emptive rebuttal, opening up the interesting question of whether allegations of dirty tricks constituted a form of dirty campaigning.

"We know now that, some time this fall, Kerry campaign operatives intend to go into pro-life chatrooms on the internet to spread a scurrilous story that President Bush drove a former girlfriend to an abortion clinic and paid for her abortion," Mr Gillespie told the Washington Times.

Dirty campaigning is nothing new in US politics: in 1800, Thomas Jefferson was accused of favouring the teaching of "murder, robbery, rape, adultery and incest".

One of Mr Nixon's operatives, Donald Segretti, was imprisoned for illegal campaign material, including faked letters alleging that a senator had fathered an illegitimate child with a 17-year-old.

The 2004 race for the White House is close, and we should not be surprised to see more dirty campaigning between now and November.