Democratic candidates have won a pair of state legislative races in districts Donald Trump decisively carried in November, offering glimmers of hope as the national party looks ahead to Congressional midterms.

In Oklahoma, Democrat Jacob Rosencrants defeated Republican Darin Chambers to claim an open seat in the state’s House of Representatives. Democrats bolstered their numbers in the New Hampshire House of Representatives as Democrat Charlie St Clair defeated Steven Whalley to secure a vacant seat formerly occupied by a Republican.

Elections for state Legislatures tend to be lower-turnout affairs that are focused on local matters like schools and taxes rather than the types of divisive issues dominating national politics. A Democratic legislator told the Oklahoman that Mr Rosencrants’ race served as a referendum on education funding, which is largely hammered out at the state or local level.

But Democrats are broadly hoping that Donald Trump’s unpopularity will buoy their chances in 2018 elections that will help determine control of Congress, and in both races Democrats claimed formerly Republican posts in districts where Mr Trump had prevailed over Democratic nominee and former Secretary of State Hillary Clinton.

According to data compiled by Daily Kos, Mr Rosencrants’ 20-point victory represented a 31-point swing over the margin compiled by Mr Trump, who carried the district by 11 points. In New Hampshire, Mr St. Claire won by 12 points a district where voters chose Mr Trump by a 17-point margin, a gap of 29 points.

Elections 2016: Agony and ecstasy for candidates as results pour in Show all 10 1 /10 Elections 2016: Agony and ecstasy for candidates as results pour in Elections 2016: Agony and ecstasy for candidates as results pour in SNP leader Nicola Sturgeon waves after winning her seat Glasgow Southside in the Scottish Parliament elections at the Emirates Arena in Glasgow Getty Images Elections 2016: Agony and ecstasy for candidates as results pour in Leader of the Scottish National Party (SNP), Nicola Sturgeon embraces Margaret Ferrier (L), and Janet Doris (R) as her husband Bob Doris (unseen) speaks to the audience at the Emirates Arena in Glasgow EPA Elections 2016: Agony and ecstasy for candidates as results pour in SNP leader Nicola Sturgeon reacts as results come in at a Scottish Parliament election count at the Emirates Arena in Glasgow PA Elections 2016: Agony and ecstasy for candidates as results pour in Labour Party members celebrate after David Burton Sampson (centre) wins the Labour seat for St Martin's ward during the election count for Basildon at the Sports Village in Basildon, Essex PA Elections 2016: Agony and ecstasy for candidates as results pour in Scottish Labour leader Kezia Dugdale, who failed in her bid to win the Edinburgh Eastern constituency from the SNP, at the count at the Royal Highland Centre, Ingliston, Renfrewshire PA Elections 2016: Agony and ecstasy for candidates as results pour in Scottish Conservative leader Ruth Davidson is congratulated after she won the Edinburgh Central seat at the count at the Royal Highland Centre, Ingliston, Renfrewshire PA Elections 2016: Agony and ecstasy for candidates as results pour in Scottish Conservative leader Ruth Davidson speaks after winning the Edinburgh Central seat at the count at the Royal Highland Centre, Ingliston, Renfrewshire PA Elections 2016: Agony and ecstasy for candidates as results pour in Scottish Conservative leader Ruth Davidson arrives at a Scottish Parliament election count at the Royal Highland Centre, Ingliston, Renfrewshire PA Elections 2016: Agony and ecstasy for candidates as results pour in SNP supporters react as their party wins another seat at a counting centre in Glasgow Reuters Elections 2016: Agony and ecstasy for candidates as results pour in Vaughan Gething of Labour retains his seat for Cardiff South and Penarth during the National Assembly for Wales election count at the Sport Wales National Centre in Cardiff, Wales Getty Images