Donald trumps coronavirus diagnosis has shaken up the us election just 32 days from polling day, forcing the president to cancel campaign rallies as he tries to gain ground on joe biden, his democratic rival.

The news early friday of mr trumps positive test came after a tumultuous week in which he struggled to address a report that he had paid very little tax in recent years and then delivered a widely panned performance in his first debate with the former vice-president.

Mr biden leads the national polls by an average of 7 per cent, according to real clear politics. he had a 13-point edge in one recent poll that coincided with the debate on tuesday.

Mr trump had hoped to energise his base by returning to the campaign trail. instead, he and his wife melania, who also tested positive for coronavirus, entered quarantine, forcing his campaign to cancel three weekend rallies one in florida and two in wisconsin.

and i tested positive for covid-19, he tweeted on friday. we will begin our quarantine and recovery process immediately.

Earlier this year, mr trump rebooted his campaign with a rally in tulsa, oklahoma, that sparked fierce criticism because of the health risks. he then scaled back his events, but switched gears after the republican convention in august, appearing at rallies in swing states including florida, wisconsin, arizona, ohio and pennsylvania.

He trails mr biden in every swing state. the former vice-president has even overtaken him in georgia, a traditionally republican state that has been becoming more liberal, and is only three points behind in texas, which has not voted for a democrat since jimmy carter in 1976.

The presidents positive test makes it more difficult for him to deflect criticism from mr biden that his failure to encourage americans to wear masks was a dereliction of duty and puts more lives at risk.

One trump donor said the news gave him a migraine for the first time in his life. but he hoped it would engender empathy and sympathy for the president two emotions mr trump has struggled to elicit from voters. he also speculated that a speedy recovery could bolster mr trumps case that he is a physically strong leader, and a stronger contender than mr biden, whom he has mocked for wearing a mask.

It sends the message...i can get through it...what about the other guy?, he added.

But dan eberhart, another trump donor, said he worried that it would hurt his campaign. all of the people he relies on daily could now be knocked out of commission by covid. that puts a huge dent in his army.

Under government guidelines, mr trump should self-isolate for at least 10 days after his symptoms emerged, which would keep him out of action for almost two of the less than five weeks left in the race.

Mr trumps campaign on friday said all his scheduled events were being converted into virtual appearances or temporarily postponed. it said events involving his family were also being postponed, but that mike pence, the vice-president who tested negative on friday, planned to resume his campaign events.

Mr trumps diagnosis comes as coronavirus cases are ticking up again in the us, according to the centers for disease control and prevention.

Cases have been rising especiallyquickly in mountain states, such as wyoming and montana, that are heavily republican. but they have also been surging in wisconsin, a critical battleground that helped mr trump beat hillary clinton in 2016.

Mr bidenhad just started to increase his in-person events, under pressure from the trump team. mr biden spent most of the pandemic at home in delaware, resuming a full in-person campaign schedule only at the end of august.

This week, mr biden had his busiest period on the trail. after the debate in cleveland, he took a train tour through ohio to pennsylvania with half-a-dozen events en route. on friday, he had been scheduled to attend events in michigan, where he was scheduled to speak about jobs and the economy.

Separately, the biden campaign announced this week that it would begin door-knocking in key swing states. that reversal came after his team had shunned the practice for most of the campaign due to health concerns, asserting that it could reach most of its target voters virtually, even as the trump campaign continued to operate on the ground, opening physical campaign offices and knocking on 19m doors around the country.

Matt bennett, co-founder of third way, a democratic think-tank, said the biden team had been under pressure to resume in-person canvassing after being spooked by new voter registration numbers coming out of swing states such as florida where registration of new republican voters strongly outpaced democrats.

But he said the news about mr trump would likely change that calculus. they have to recalibrate. the perception of risk has changed, said mr bennett, who believes that both campaigns would probably now be virtual.

Deborah spencer, an undecided voter in blacksburg, virginia, said she was not swayed either way. but she said she had been frustrated by mr trumps handling of covid-19, and not taking masks and other precautions seriously.

Ihate to say it, but he flaunted the facts and ouch, ms spencer said.

Additional reporting by kiran stacey

Follow demetri sevastopulo and courtney weaver on twitter