Ballot boxes are delivered for counting in the Lewisham East byelection.

Labour’s Janet Daby has won the Lewisham East byelection and immediately promised to oppose a hard Brexit, after the party’s margin of victory was cut by a resurgent Liberal Democrats in the heavily pro-remain seat.

Daby took just over 50% of the vote in the south-east London constituency, ahead of the Lib Dems’ Lucy Salek, who won 25% of the vote – a 20% rise in the party’s share of the vote – to leapfrog the Conservatives and take second place. The Conservative share fell by 8% after their candidate, Ross Archer, won less than 9% of the votes.

Labour held Lewisham East with 50.2% of the vote – down 17.75 points since June 2017Standfirst …%0%1020304050Lab Janet Daby 50.2% (11,033 votes)Lib Dem Lucy Salek 24.59% (5,404)Con Ross Archer 14.38% (3,161)Green Rosamund Adoo-Kissi-Debrah 3.59% (788)Women’s Equality Mandu Reid 2.30% (506)Ukip David Kurten 1.73% (380)Guardian Graphic | Turnout 69.28% (47,201)

Daby won a closely contested internal Labour battle to run for the safe seat vacated by Heidi Alexander, who quit parliament to work with the mayor of London, Sadiq Khan.

The former Lewisham councillor said the result showed “we will not tolerate an extreme Brexit in Lewisham East”.

“I will oppose an extreme or a hard Brexit,” she said. “I will consider people’s jobs, the economy and people’s rights, and that will dictate to me the precedent in how I will conduct myself both within parliament and out of parliament.”

The Labour share of the vote fell by almost 18% from the 2017 election, and, with a much-reduced turnout from last year, Daby secured a majority of 5,629, compared with the 21,213 seen by Alexander.

The Lib Dems claimed the swing was the biggest against Labour in a seat since 2004, and the most significant since 1983 when Labour was in opposition.

The Lib Dem leader, Vince Cable, who campaigned in the constituency a number of times, said Salek had “fought a proud, pro-European campaign”.

“This result sends a message to the Labour leadership that it cannot take pro-European voters for granted.

“This is the largest swing from Labour to the Liberal Democrats…