Polls have closed in the by-elections being held in Wakefield and Tiverton and Honiton.
Both seats were held by the Conservatives before their previous MPs resigned in disgrace, triggering the by-elections.
Results are expected to be announced overnight.
The polls are regarded as a key test for Prime Minister Boris Johnson‘s leadership after 148 of his own MPs voted against him in a confidence vote.
Counting begins as PM faces nervy night – follow latest updates
Asked whether he would consider his position if he lost both by-elections, the prime minister said: “I’m going to be watching the results with interest.”
While “always full of optimism and buoyancy”, the PM cautioned: “I think most seasoned political observers such as yourself know that by-elections in midterm are never necessarily easy for any government.”
Elections live: Counting begins as PM faces nervy night with Labour and Lib Dems aiming for by-election victories
Boris Johnson may be abroad but he can’t escape enormity of first ballot box test since confidence vote
Source of polio virus could be narrowed down ‘to individual households or streets’, minister says
In Wakefield, West Yorkshire, ex-Conservative MP Imran Ahmad Khan stood down after being found guilty of sexually assaulting a 15-year-old boy and being jailed for 18 months.
Once one of the so-called Red Wall seats, it was won by the Tories in the 2019 general election, though Labour is now hoping to take it back.
In Tiverton and Honiton, Devon, Neil Parish resigned after admitting he had watched pornography twice on his phone in the House of Commons.
The Liberal Democrats have their sights set on the constituency and would need to overturn a Conservative majority of 24,239.
If the Conservatives lose both by-elections, it would be only the seventh time a government has suffered a double defeat since the Second World War.
Labour’s national campaign coordinator Shabana Mahmood said voters were returning to the party under Sir Keir Starmer’s leadership.
She said: “Labour has run positive campaigns with fantastic candidates in both by-elections – but we know that taking the seats requires many Tory voters to switch to Labour, which is harder in by-elections where low turnout is commonplace.
“Wakefield has been a marginal constituency since Labour last won a General Election, and the Conservatives hold the seat with the biggest majority since 2010 – making this an uphill task.
“While we await the results in both elections – the message we have heard is clear: many are coming back to Labour under Keir Starmer’s leadership.”
The Liberal Democrats said a significant swing away from the Tories in Tiverton and Honiton, one of the party’s safest seats, could see Mr Johnson’s MPs looking nervously over their shoulder.
Treasury spokesperson Christine Jardine said: “Never in the history of British politics has a majority this big been overturned in a by-election. We’ve said throughout this campaign this is a huge mountain to climb.
“However, if the Conservative Party lose significant numbers of votes tonight in one of their safest seats in the country, there will be countless Conservative MPs looking over their shoulders nervously tomorrow. “