Voting for a Republican president runs in the blood of places like Gainesville. The pretty little town of 15,000 sits in north Texas ranch country and it is safe to say that Barack Obama has few fans here. Certainly Jim Farquhar, who works in the justice system, has taken to heart warnings that Obama has links with dangerous radicals, such as former 1960s militant Bill Ayers.

'Obama scares me. He has all these friendships. You just don't know how that might effect him once he gets into office,' Farquhar said as he stood outside Gainsville's sturdy old courthouse. 'I'm voting for John McCain.'

Such worries are increasingly not shared by many other Americans. Weeks of relentless attacks on Obama by McCain and his running mate Sarah Palin have not succeeded in denting Obama's lead. Instead it has strengthened. Across America, battleground states such as Ohio and Pennsylvania are falling into Obama's column and southern states such as Virginia and North Carolina are going from red to blue. Some Democratic insiders are even whispering about the prospect of a landslide.

The flipside of that is a potentially devastating Republican loss. If current polling holds true, the party may be reduced to its core support in the solid red heartland that runs through Texas, Oklahoma, Alabama, Georgia and other southern and western states. That would trigger a profound crisis for a party that just three years ago was basking in the afterglow of a convincing presidential win and dreaming of creating a 'permanent majority'.

Now that same Republican party could face a prolonged period in the political wilderness, working out how to appeal to an American public that seems prepared to send a pro-choice, black senator from Chicago to the White House and reject a conservative Republican war hero.

'The Republican party is going to have to work out what sort of party it actually wants to be. It's a changing world for them,' said Professor Shaun Bowler, a political scientist at the University of California at Riverside. It might not be easy. A powerful Democratic win could wipe out Republican moderates. It could leave the party in the grip of its conservative and evangelical base who remain critical of figures such as McCain but who are wildly enthusiastic about politicians such as Palin. The Republican party could end up in a bitter civil war for its political future.'

One of the key battlegrounds in that conflict will be the role of religion in Republican politics. The evangelical base has been a key part of the political coalition that has brought the party such success in recent years. Political guru Karl Rove cemented evangelical ideas into President George W Bush's brand of conservatism and used them to inspire a very effective 'get out the vote' team in elections.

Rove focused on social issues such as gay marriage and abortion as a way of ensuring fanatical evangelical support. Nothing came to symbolise the power of the evangelical movement more than the rise of mega-churches, especially in staunchly Republican areas. These enormous edifices now dot the landscape of many states and Texas is no exception.

In the northern Dallas suburb of Prosper, a new mega-church has just opened. It is called Prestonwood North and is a branch of its mother church a few miles south in Plano, a fast-growing city of some 260,000 people. At first glance the church looks like a sparkling new office development, identical to many other buildings popping up on farmland as these 'exurbs' of Dallas succumb to development. But the large cross on its front reveals the truth. Taken as a whole, Prestonwood now has almost 30,000 members, making it one of the largest churches in America. It was recently named as one of America's 50 most influential churches.

It certainly fits in in Prosper. Once a hamlet, it is gradually being swallowed by the suburbs, but its politics remain God and guns. 'People around here all voted for Bush. That has not really changed. It's a churchgoing kind of place,' said Michelle Williams, 32, a dental nurse.

In Texas, church and politics have been mixing. In recent weeks, leading evangelical leaders in the state have endorsed McCain from their pulpits. They include Pastor Gary Simons, who heads a church near Dallas. He compared Obama to King Herod, the biblical child killer, because of his support for abortion. 'How many of you would want to go to the polls and vote for Herod?' Simons asked his congregation.

But increasingly such nakedly political preaching is looking out of step with many religious voters. Obama, who is a regular churchgoer and looks at ease in religious surroundings, has made huge strides in appealing to evangelical voters. His campaign has aggressively courted the religious vote, holding regular meetings with evangelical leaders.

That is in marked contrast to the 2004 Democratic nominee, John Kerry. It has worked too. A recent survey showed Obama and McCain in a virtual dead heat among born-again Christians, with support for McCain running at 45 per cent and Obama on 43 per cent. In 2004, Bush won 62 per cent of that vote. 'If Obama goes on to win, one of the significant stories will be the profile of the faith vote ... the Democrats are poised to make up significant ground among born again and evangelical voters,' said David Kinnaman, president of the evangelical research group that carried out the poll.

The trend is also likely to reflect growing differences in the evangelical movement itself; changes that are leaving the Republican party behind. Far from being a monolithic bloc, evangelicals have increasingly embraced a wider variety of causes. Some are just as likely to campaign on fighting Aids and issues in the developing world as to crusade against abortion and gay marriage. One of the hottest topics in conservative Christianity at the moment is environmental conservation and global warming, neither of which is a Republican strong suit.

Yet, following a possible November defeat, the Republican party itself could still remain firmly in the hands of its conservative evangelical wing. Even as America drifts away from causes that right-wing evangelicals care about, the Republican base remains fixated on them. After all, McCain was forced to court the evangelical vote in order to secure the nomination himself.

To cement his position, he ended up choosing Palin - a true religious conservative - as his running mate. That move electrified die-hard Republicans but turned off other voters for whom the collapsing economy - not fighting the teaching of evolution in schools or banning abortion - has become the overriding concern. It allowed Obama to seize the vital middle ground.

'In the Republican party itself it seems that the Christian right is going to be in the ascendancy. But that is looking like a losing political strategy for the future,' said Bowler.

There is increasingly a sense that what works for the Republican base no longer works for the rest of the country, even in the heart of red state America. Take Kingfisher, Oklahoma. The town sits in the middle of a county that is one of the reddest in America when it comes to presidential politics. It voted for Bush over Kerry in 2004 by a staggering 85 per cent to 15 per cent. Even now the state of Oklahoma remains spectacularly loyal to the Republicans. The most recent poll showed McCain 24 points ahead of Obama. A previous one gave him a lead of more than 30 per cent.

But even in Kingfisher the signs of Republican disarray are not hard to find. Businesswoman Charlene Franks is put off by the campaign that McCain and Palin are running. 'I am voting for McCain but I don't really like it. It's the economy that matters right now and groceries are getting expensive. We really don't eat that much any more,' she said. Her views on Palin were not complimentary either. 'She is not ready to be president,' Franks said.

Ready or not, Palin is still likely to be one of the most dominant forces in Republican politics after the election. Unlike McCain, she draws thousands to her rallies. She has developed a genuinely enthusiastic following among activists who are dedicated to her cause. Already there is speculation that Palin, if McCain loses in November, will be the hottest pick for the nomination in 2012.

That will be made easier by a large-scale electoral defeat. In a process reminiscent of the Labour party in the 1980s and the Conservatives in the late 1990s, the Republicans could end up as an extremist rump, reduced to a few stronghold states and obsessed with causes that seem not to matter to the general public.

Across America, moderate Republicans are facing a tough battle as the Democrats look set to increase greatly their strength in Congress. Some analysts are seeing Democratic gains of up to nine Senate seats and 30 seats in the House of Representatives. In a leaked Republican party document last week, an incredible 58 House seats were ranked as potentially at risk with 11 of them virtually written off as already lost.

If the Democrats perform strongly enough to control 60 Senate seats then they would have a virtual free rein over the political landscape. Republicans would probably survive only in their heartland, thus thrusting the party further right at a time when the country has shifted left. That would mark a profound change similar to Ronald Reagan's win in 1980 which seemed to usher in a conservative-dominated era.

The possibility has many Republican pundits terrified. 'The end of the Reagan era?' blared one headline in the political magazine National Journal. The Wall Street Journal added fuel to the fire with an editorial that went ever further. 'Get ready for change we haven't seen since 1965 or 1933,' it warned under the headline: 'A liberal supermajority'.

Such a prospect angers conservative Republicans. But much of that anger is directed at the current occupant of the White House. For eight years Bush preached conservatism from the Oval Office. He spoke of a desire for small government, limited spending and an emphasis on social issues such as fighting abortion. Instead the size of government has increased - mostly due to the creation of the Department of Homeland Security - and spending has rocketed because of Iraq and Afghanistan.

On social issues, Bush has delivered a more conservative Supreme Court but abortion remains legal. In a final blow to conservative ideals, the economic crisis has seen Bush's administration preside over the semi-nationalisation of swaths of the financial services industry.

No wonder there is anger on the streets of places like Gainesville. After all, the Texas town backed Bush in 2004 with 79 per cent of the vote. Now its people feel they did not get what they voted for. 'There's been no leadership. I liked Bush as a man. He was not very polished, but that was part of his appeal. But things have not turned out well,' said Bill Wilkinson, a writer, as he walked past a cafe on Gainesville's town square.

Of course, it is still premature to declare an Obama victory. 'Anything can happen. But the election is clearly Obama's to lose,' said Kinnaman.

McCain has built a long political career on unlikely comebacks. He might yet pull off the biggest surprise of his life. But for the moment the signs are grim across the Republican heartland.

From Kingfisher, Oklahoma, to Gainesville, Texas, and far beyond the mood is sour. 'I guess it looks like Obama is going to make it,' said Farquhar. 'But no one is happy about it. It is going to be beyond just having another tax-and-spend liberal in office.'

That will be for the future to decide. But for the moment it looks as if Obama and the Democrats are preparing for the highest office in America, to add to their control of both House and Senate. The Republicans, meanwhile, are bracing for what could be a painful period of exile.

• This article was amended on Wednesday October 29 2008. We referred to Barack Obama as the 'pro-life black senator from Chicago'. Obama supports a women's right to choose; we meant 'pro-choice'. This has been corrected.