The Labour Party has narrowly seen off a challenge from the Brexit Party and held on to its seat in the Peterborough by-election.
Union activist Lisa Forbes managed to retain the seat for Labour, winning 683 more votes than Nigel Farage’s candidate Mike Greene.
Paul Bristow for the Conservatives came in third place.
The by-election was called after former MP Fiona Onasanya’s conviction for lying over a speeding offence.
Ms Onasanya was dismissed from the Labour Party in December 2018 and was jailed for three months in January.
Constituents backed a recall petition demanding a fresh election, the first time this has happened in the UK.
Labour won a 31% share of the vote, with 10,484, down 17% on the 2017 election.
The Brexit Party won 29% of the votes with 9,801, with the Conservatives taking a 21% share with 7,243 votes.
A total of 15 candidates stood in the by-election, including Beki Selleck for the Lib Dems, and John Whitby for UKIP, with the Brexit Party vying for its first MP after gaining 29 seats in the European elections.
Turnout for the Peterborough contest was 48.4%, down from the 67.5% turnout for the 2017 general election.
Labour and the Brexit Party had jostled for position as the bookmakers’ favourite up until the result was announced.
- The 15 candidates fighting for Peterborough
- By-election in ‘mother of all marginals’
- Jailed MP loses appeal against conviction
Both Labour and the Conservatives campaigned hard ahead of the by-election, with Labour leader Jeremy Corbyn, former prime minister Gordon Brown and Tory big guns Boris Johnson and Jeremy Hunt all visiting the city in the lead-up.
The Europe issue
With the Brexit process currently deadlocked and the Conservatives searching for a new leader and prime minister, the issue of Europe has dominated the campaign.
The city voted by a large margin to leave the EU in the 2016 referendum while the Brexit Party won twice as many votes in last month’s European elections as any other party.
Aside from Europe, other issues to have featured in the campaign include the need for more skilled jobs and affordable housing and concerns about fly-tipping.
Previous MP ousted
Ms Onasanya chose not to stand again after 27.6% of eligible constituents backed a recall petition, in excess of the 10% threshold required to force a by-election.
It was the first time the procedure had been successfully triggered since legislation was passed in 2015 to enable the public to hold MPs who had been found guilty of serious wrongdoing to account, without having to wait for another general election.
Ms Onasanya, a former solicitor, was expelled by Labour after she was sentenced to three months in jail in January for perverting the course of justice in relation to a speeding offence.
She lost her appeal against the conviction.
The ‘mother of all marginals’
The Peterborough constituency has long been a Conservative-Labour marginal and, despite boundary changes over the years, is still regarded as one of England’s bellwether seats.
The Conservatives held the seat throughout the 1980s before Labour won it in Tony Blair’s 1997 election landslide.
It swung back to the Tories in 2005 before Labour won it again in the 2017 snap election.
The margin of victory in the seat has often been wafer-thin. The Conservatives won it by 22 votes in February 1974 and by just three votes in 1966.
Theresa May, who will officially resign as Conservative leader on Friday, has not visited the constituency during the campaign.
But Boris Johnson, Michael Gove and Sajid Javid are among the contenders to succeed her who have hit the campaign trail.
The view from the count
By Ben Schofield, political correspondent, BBC Look East
Almost from the moment this by-election was called, a circus has descended upon Peterborough.
Candidates, activists, cabinet members and the national media have hit the city to see political history unfold.
This is the first time we’ve seen an MP elected after the last was sacked by her constituents.
It was also the first big test of Nigel Farage’s Brexit Party, which came top in the Euro elections.
Their candidate Mike Greene had been odds-on favourite with the bookies for more than a week.
The by-election candidates were:
Brexit Party – Mike Greene
Christian People’s Alliance – Tom Rogers
Common Good: Remain in the EU – Dick Rodgers
Conservatives – Paul Bristow
English Democrats – Stephen Goldspink
Green Party – Joseph Wells
Independent – Andrew John Moore
Independent – Bobby Smith
Labour – Lisa Forbes
Liberal Democrats – Beki Sellick
Official Monster Raving Loony Party – Alan “Howling Laud” Hope
Renew – Peter Ward
SDP Fighting for Brexit – Patrick O’Flynn
UK European Union Party – Pierre Kirk
UKIP – John Whitby