Barack Obama accused John McCain of resorting to smear tactics yesterday as Republicans showed signs of alarm at the prospect of a Democratic clean sweep in both the White House and Congressional races on November 4.

His attack came after McCain's team, in an unusual step, signalled at the weekend that it is to switch strategy towards more personal and nastier criticism of Obama.

McCain's team offered an early glimpse of the new strategy by accusing Obama of being friends with a terrorist, Bill Ayers. He is one of the founders of the Weathermen, a radical underground group responsible for a bombing campaign in the US in the 1970s.

The aim of the McCain team appears to be to try to shift attention away from the economic crisis that has led to a haemorrhaging of Republican support over the last two weeks.

Having entered the final 30 days of the campaign, during which the views of undecided voters begin to consolidate, polls and reports from Democratic and Republican campaign staff on the ground suggest a seismic shift is taking place in the electoral map in favour of the Democrats.

Republican vice-presidential candidate Sarah Palin speaks at a campaign rally in Carson, California, on Saturday. Photograph: Jewel Samad/AFP

The optimism in the Obama camp is based not just on the poll leads but on voter registration.

Obama has more staff and volunteers on the ground and has registered millions of new Democratic voters, an effort unmatched by the Republicans. The Democrats' team revealed at the weekend it has registered 1.5 million new voters in swing state Pennsylvania alone.

Unlike in 2004, when the failed Democratic candidate John Kerry was slow to respond to personal attacks, Obama is countering fast. In a speech on the campaign trail in Asheville, North Carolina, Obama accused McCain of trying to divert voters from the economic crisis.

"Senator McCain and his operatives are gambling that he can distract you with smears rather than talk to you about substance. They'd rather try to tear our campaign down than lift this country up. It's what you do when you're out of touch, out of ideas, and running out of time."

The Democratic candidate is making inroads into states once regarded as safe Republican areas, while the number of states in which McCain is competitive is narrowing, mainly because of the Wall Street collapse.

The Republican concern is that they stand to lose not only the White House but that the Democrats will also come out of the election with bigger majorities in the Senate as well as the House, giving them a rare dominance in Washington.

McCain is expected to raise questions about Obama's character in a presidential debate in Nashville, Tennessee, tomorrow night - one of the dwindling number of chances for the Republican candidate to turn the race around.

The Obama campaign will follow up its candidate's attack on smear tactics by airing an ad on cable television accusing McCain of being "erratic in a crisis" and out of touch, adding: "No wonder his campaign wants to change the subject."

Tim Pawlenty, the Republican governor of Minnesota and part of McCain's inner circle, yesterday criticised Obama for attending a political event in Ayers's home in Chicago. Pawlenty, who had been on the shortlist as a running mate for McCain, said Ayers was "an unrepentant domestic terrorist".

Speaking to Republican sympathisers at a fundraiser in Colorado on Saturday, McCain's running mate, Sarah Palin, also raised the link with Ayers. "Our opponent though is someone who sees America, it seems, as being so imperfect, imperfect enough that he is palling around with terrorists who would target their own country," Palin said.

She added: "There is a time when it's necessary to take the gloves off and that time is right now."

Ayers, who is now a professor in Chicago, worked on the board of a charity alongside Obama distributing educational funds. Although the relationship between the two was not close, a video is appearing on websites showing Ayers morphing into Obama.

As well as Ayers, the Republicans are planning to reopen the Democratic candidate's ties with Antoin "Tony" Rezko, the Chicago property developer and early funder when Obama stood for the Senate. In awkward timing for Obama, Rezko is due to be sentenced for fraud just days before the election, on October 30.