With just two days until the midterm elections that could decide the fate of the last two years of President Donald Trump’s first term in office, Democrats have retained a sizeable but shrinking advantage in their quest to retake at least one chamber of the US congress – a result that would impact important debates on healthcare, taxes, and immigration policies in Washington.

The rosier outlook for Republicans comes as a result of an increasingly optimistic outlook on the economy, and Mr Trump’s harsh focus on immigration and border security issues that have historically energised GOP voters.

With that tightening as a backdrop, the president released a flurry of retweets of himself on Sunday morning, amplifying once again the candidates and issues he has tweeted support for in the past – including Senate candidate Martha McSally in Arizona, gubernatorial candidate Ron DeSantis in Florida, and the misleading story of an undocumented immigrant cop killer who the president has identified as a false signal of Democrats’ weakness on immigration.

Even though several races are considered to be in dead heats across the country, Democrats have retained an 8-point advantage in the general congressional ballot, according to a new Washington Post/ABC News poll. The poll shows American voters preferring Democrats over Republicans 50 per cent to 43 per cent – a slight decline from last month when they were preferred by 11 points, and in August when they led by 14 points.

While those numbers are reason for optimism for Democrats hoping to retake control of the House of Representatives come January – a majority that would allow them to effectively kneecap the president’s agenda during the second half of his first term – it is not possible to determine how that general voter preference will translate in individual districts where contentious battles are being waged throughout the country.

Democrats need 23 seats to take control of the House, and both parties have been spending at record levels to try and ensure their control of the people’s chamber.

US midterm elections: the voters Show all 10 1 /10 US midterm elections: the voters US midterm elections: the voters Ross Kershey of Exton, Pennsylvania objects to President Trump's recent threat to unilaterally suspend the constitutional protection of birthright citizenship as a way to control undocumented immigrants AP US midterm elections: the voters Thomas Jakel of Eveleth Minnesota is a former miner. The economy is the most important thing to voters in his town AFP/Getty US midterm elections: the voters Jerry Mcneff of Exton, Pennsylvania intends to split his ballot between the parties for Pennsylvania's House, Senate and governor elections AP US midterm elections: the voters Jean Hoffman of Exton, Pennsylvania has concerns about the cost of her daughters' college education. She thinks that voting Republican might help extend the economy's rise AP US midterm elections: the voters Supporters attend a rally of President Trump in Rochester, Minnesota AFP/Getty US midterm elections: the voters Supporters attend a rally of President Trump in Rochester, Minnesota Reuters US midterm elections: the voters Supporter Jenny Haley and son wait in line to see a Trump Rally in Rochester, Minnesota AFP/Getty US midterm elections: the voters Dick Calef of Exton, Pennsylvania is a life-long Republican. He credits the economic gains in suburban Philadelphia to longer-term factors beyond Trump's policies, such as the growth of internet and health care companies. He's not yet sure how he will vote AP US midterm elections: the voters Markus Fasel of Mendota Heights, Minnesota attends a campaign event for Democrat Angie Craig, his favoured congressional candidate AFP/Getty US midterm elections: the voters Supporters attend a rally of President Trump in Rochester, Minnesota Reuters

Campaigns, parties and outside groups have spent a record-setting $4.7bn on congressional races – and that figure may jump to $5.2bn by the time the election is over. That record sum has been buoyed by Democratic spending as they seek to secure those 23 districts while defending the few races where Democratic incumbents are threatened.

The Cook Political Report – a leading handicapper for American political races – has identified 73 of the 435 House seats as as competitive this year. That’s good news for Democrats, as 69 of those seats are currently in Republican hands.

Republicans have a considerable advantage in the Senate, where the majority of seats up for grabs this year have Democrats on the defensive. The current Senate makeup gives Republicans a 51-49 advantage, and, of the seats up for grabs, Democrats are defending 10 seats in states where Mr Trump won in 2016.

If Democrats manage to wrestle control of the House or Senate – or both – then that could have a dramatic impact on Mr Trump’s legislative agenda over the next two years.

The president has already found it difficult to push through some of his legislative priorities with Republican control of both chambers. His first two years in office have seen a high profile failure to repeal the Affordable Care Act, and those efforts have become a major campaign talking point for Democrats who note that Republican votes on that effort would have removed protections for people with pre-existing conditions – that is in spite of Republican assurances that they do not want to repeal those protections.

Support free-thinking journalism and attend Independent events

Other legislative priorities including immigration reform, a topic that has been a cornerstone of the president’s rhetoric since the first day of his 2016 election campaign. Mr Trump has sought to frame the midterms as a referendum on himself, and on what to do about immigrants coming to the US seeking refuge or new lives. But, he has also been unable to move any significant legislation on immigration through congress with Republican control there.