Labour has held the south London constituency of Tooting in a by-election following the departure of new Mayor of London Sadiq Khan.
Junior doctor Rosena Allin-Khan received 17,894 votes, winning with a majority of 6,357.
She paid tribute to "proud and passionate" Labour MP Jo Cox, who was killed in her West Yorkshire constituency on Thursday.
Earlier, a two-minute silence was held during the count in tribute to Mrs Cox.
Conservative candidate Dan Watkins, who had come second to Mr Khan at the 2015 general election, received 11,537 votes.
Dr Allin-Khan said that due to the "horrific events of yesterday and the shocking death of Jo Cox" she would not make a speech.
But she said her thoughts and prayers were with Mrs Cox's husband and her children.
"She was a proud and passionate campaigner who will be desperately missed," Dr Allin-Khan said.
"Jo's death reminds us that our democracy is precious but fragile - we must never forget to cherish it.
"Thousands of people voted today and we are all here in recognition of our democratic values."
Labour MP for Eltham, Clive Efford, said there would be no celebrations in Tooting following the death of Mrs Cox.
"It's not appropriate. No-one feels in the mood," he said.
"This has never happened on an election campaign. We just had to dry our tears and get out there."
At the scene
By Ben Wright, BBC political correspondent
"Please excuse my interruption. I would like to ask the counting teams and party agents to take a brief pause in their activities."
And at the Mayor of Wandsworth's gentle instruction, the Tooting by-election count was hushed.
At trestle tables piled with yellow ballot papers, council staff stopped what they were doing and solemnly took part in a two-minute silence for the Labour MP Jo Cox, who died after she was attacked in her West Yorkshire constituency.
It was a sombre, poignant evening, the process of electing an MP horribly overshadowed by the death of another.
But as the Wandsworth mayor, councillor Richard Field, said as he introduced the declaration, the process of democracy must continue.
The result, when it came, was not surprising.
The former Tooting MP and new London Mayor Sadiq Khan held this seat in 2015 with a majority of 2,842.
The constituency's new Labour MP, Dr Rosena Allin-Khan, is Tooting born and raised and works as an A&E doctor at the local St George's Hospital.
But she and her party will be delighted with the result, increasing Labour's majority to 6,357.
But there was no applause here at Wandsworth Town Hall when the result was announced.
Earlier, Returning Officer and Mayor of Wandsworth Richard Field said he wanted to "express the sadness everyone involved in this by-election has felt".
Mr Field said the "tragic event" had a "very deep resonance here in this room, as the votes are counted for Tooting's new member of Parliament".
He said he wanted to "convey our deep-felt condolences to those closest" to Mrs Cox.
The flag over Wandsworth Town Hall was flying at half mast, Acting Returning Officer Paul Martin said.
He said the killing had cast a "very dark shadow" over the day.
The MP for Batley and Spen died after being shot and stabbed outside her constituency advice surgery in Birstall, West Yorkshire, on Thursday.
Mr Martin said the killing had "shocked the entire country, and it has hit home particularly hard in Tooting where right now the community is in the process of selecting a new member of Parliament to represent their interests".
"It is our duty and responsibility to continue with this by-election, but clearly a very dark shadow has been cast over these proceedings. The flag over Wandsworth Town Hall is now flying at half mast and we will hold a two-minute silence during this evening's count to reflect upon this awful loss."
He added: "Our thoughts, prayers and deep condolences are with Jo's family and loved ones at this incredibly difficult time."
- Rosena Chantelle Allin-Khan (Labour Party) - 17,894 (55.9% +8.7%)
- Dan Watkins (Conservative Party) - 11,537 (36.1% -5.8%)
- Esther Dede Obiri-Darko (Green Party) - 830 (2.6% -1.5%)
- Alexander James Glassbrook (Liberal Democrats) - 820 (2.6% -1.4%)
- Elizabeth Eirwen Jones (UK Independence Party) - 507 (1.6% -1.3%)
- Des Coke (Christian People's Party) - 164
- Howling Laud Hope (The Official Monster Raving Loony Party) - 54
- Graham Harry Moore (English Democrats Love England - Leave EU!) - 50
- Dr Akbar Ali Malik (Immigrants Political Party) - 44
- Ankit Love (One Love Party) - 32
- Zirwa Javaid (Independent) - 30
- Dr Zia Samadani (Independent) - 23
- Bobby Smith (Give Me Back Elmo) - 9
- Smiley Smillie (Independent) - 5
Change compared with 2015 General Election. The turnout was 42.5%, with 31,763 votes cast out of 74,701 eligible voters.