THE most interesting election result on May 13th was not Hillary Clinton's 41-point victory over Barack Obama in the Appalachians. It was the Republicans' loss of an ultra-safe seat in a special election in northern Mississippi. West Virginia was the swan-song of a dying campaign. Mississippi was a harbinger of disaster for congressional Republicans in November—and a warning of how difficult it will be for John McCain to win the White House.

It is rare for a party to win a third presidential term. The only time it has happened since Harry Truman's time was in 1988. Back then the retiring president, Ronald Reagan, had a job-approval rating in the high 50s. George Bush's job-approval rating is stuck in the low 30s. Nearly three in four Americans tell pollsters that the country is on the “wrong track”.

The Mississippi result demonstrates that the anti-Republican mood, which gave the Democrats control of both the House and the Senate in 2006, is getting ever stronger. In 2004 the Republicans won the seat with 79% of the vote; they took it in 2006 by 66% to 34%. This is the third safe seat in a row that the Republicans have lost.

On March 8th they lost Dennis Hastert's seat in Illinois, a district that George Bush carried by ten points in 2004. They lost another safe seat, this one in Louisiana on May 3rd, that they had held for 33 years. And then they lost the Mississippi seat as well. Chris Van Hollen, the chairman of the Democratic Congressional Campaign Committee, gave warning: “there is no district that is safe for Republican candidates.”

But does this mean that the party's unpopularity will drag down Mr McCain? It is true that the senator is no identikit Republican. He has spent years railing against the pork-barrel spending that has alienated so many rank-and-file Republicans. He has embraced un-Republican issues such as global warming, speaks to Hispanic groups such as La Raza, and conducted a tour of impoverished America. He stood in New Orleans's devastated ninth ward and condemned the Bush administration's lamentable handling of Hurricane Katrina. If any Republican can survive an anti-Republican hurricane, it is Mr McCain.

Equally, though, Mr McCain cannot survive without the support of Republican stalwarts. These are the people who man the phone banks and knock on doors. They are also the people who fill the coffers. Accordingly, Mr McCain has abandoned his earlier opposition to Mr Bush's tax cuts and re-emphasised his support for appointing conservative judges.

But many activists still regard him as a cuckoo in the nest. Mr McCain has not broken 80% of the vote in Republican primaries since securing the nomination. He won only 73% in the vital state of Pennsylvania. If Bob Barr, a former Republican turned libertarian, wins the Libertarian Party's nomination, he could attract disillusioned Republican votes in November.

Mr McCain faces an expanding and energised Democratic Party that is desperate to retake the White House. In many primary states twice as many Democrats have turned out to vote as Republicans. And he is on the wrong side of the two biggest issues at the heart of the election. The first is the war in Iraq. Mr McCain—or “McStay” as the Democrats have taken to calling him—is an instinctive hawk at a time when America has grown weary of foreign entanglements (60% of Americans think that the Iraq war was a mistake, for example). MoveOn.org, a Democratic pressure group, is running endless ads quoting Mr McCain saying that America could be in Iraq for another hundred years, a statement that could come to define him—much as John Kerry's statement that he voted in favour of funding the war before he voted against it defined him as a flip-flopper in 2004.

The second issue is change. For all his maverick reputation, Mr McCain goes into the general election wearing a scarlet “R” and tainted by his association with Mr Bush. The fact that he is 71 also makes it difficult for him to cast himself as an agent of change. Mr Obama repeatedly says that “We can't afford to give John McCain the chance to serve out George Bush's third term.” For all his talk of being above partisan bickering, Mr Obama has also been happy to play the age card, accusing Mr McCain of “losing his bearings”.

Mr McCain is also up against a formidable political machine. The McCain camp has repeatedly hinted that they regard Mr Obama as a weaker opponent than Mrs Clinton. Some conservatives persist in seeing him as a cross between Michael Dukakis and George McGovern. But they underestimate the Chicagoan at their peril.

Mr Obama has put together the most disciplined and creative Democratic political machine in recent memory—one quite capable of defeating the formidable Clinton machine. Mr Obama already has a national political apparatus in place, thanks to the prolonged Democratic primary. He also has money coming out of his ears. Mr Obama raised $41m in March compared with Mr McCain's $15m. Mr McCain's likely decision to take public funding will limit him to $84m in the two months before the election. Mr Obama will be able to raise many times that amount.

Mr Obama certainly has weaknesses that the grizzled Republican can exploit. Mr McCain, a war hero, is up against a man who had doubts about wearing a flag pin. The Arizona senator is a genuine “reformer with results”—a man with a long record of taking on vested interests and working with the opposite party—who is up against a man with the most liberal voting record in the Senate. With the Democratic nomination all but settled, the real fight is now on. But Mr McCain is swimming against a mighty tide.