President Donald Trump is to seek a partial recount of votes in the state of Wisconsin which his rival Joe Biden is projected to win by 20,000 votes.

Hours before a Wednesday deadline, the Trump campaign said it wanted a recount in the counties of Milwaukee and Dane, alleging irregularities.

State officials said they had received $3m (£2.2m) from the Trump campaign to cover the costs of the recount.

A statewide recount would have cost the campaign an estimated $7.9m.

Mr Trump still refuses to concede the election and continues to make unsubstantiated claims of “massive” voter fraud.

His campaign team has filed a flurry of lawsuits contesting the results in key states, although election officials say there is no evidence of widespread irregularities.

President-elect Joe Biden, a Democrat, is projected to have won the popular vote by more than 5.6 million ballots – 3.6 percentage points – although some votes are still being counted. In the US electoral college system that decides the presidency, he has 306 votes to Mr Trump’s 232.

The president would have to overturn results in at least three states to win the election, which analysts say would be unprecedented. A recount is currently under way in Georgia where Mr Biden is 14,000 votes ahead.

In its request for a partial recount in Wisconsin ahead of Wednesday’s deadline, the Trump re-election campaign alleged that absentee ballots had been altered and improperly issued, and voter identity laws had been circumvented. Milwaukee and Dane are both traditionally Democratic-leaning areas.

The Wisconsin Elections Commission said on Monday that a full recount would cost an estimated $7.9m, to be paid in advance. Chief election official Meagan Wolfe said the costs took into account the need for larger spaces to allow public observation and social distancing as well other expenses such as security.

The latest move comes a day after Mr Trump fired a top cybersecurity official who had contradicted his claims of voter fraud.

President Trump said he “terminated” Cybersecurity and Infrastructure Security Agency (Cisa) chief Chris Krebs for his “highly inaccurate” remarks on vote integrity.

Mr Krebs had reportedly angered the White House over a Cisa website called Rumor Control, which debunked election misinformation, much of it amplified by Mr Trump himself.

Hours before he was fired, he posted a tweet that appeared to take aim at Mr Trump’s allegation that voting machines in various states had switched ballots to Mr Biden.

Mr Krebs tweeted: “On allegations that election systems were manipulated, 59 election security experts all agree, ‘in every case of which we are aware, these claims either have been unsubstantiated or are technically incoherent.’ #Protect2020”.

Mr Krebs’s dismissal brought outrage from Democrats. A spokesman for President-elect Joe Biden said “Chris Krebs should be commended for his service in protecting our elections, not fired for telling the truth”.

Meanwhile, the Trump campaign faces a deadline of 8 December to resolve all election disputes. Official results are set to be confirmed when the US Electoral College meets on 14 December.