Labour's Tracy Brabin has been elected as the new MP for Batley and Spen.
Mrs Brabin has won the seat previously held by Labour MP Jo Cox, who was killed in June.
The soap actress and screen writer was friends with Mrs Cox, and helped her canvass for votes before her election in 2015.
Mrs Brabin won the seat with a total of 17,507 votes.
She thanked the people of Batley and Spen and said she was proud of her community and paid tribute to her friend Jo.
She said: "Tonight is a bittersweet occasion for me. That this by-election had to take place at all is a tragedy.
Shouting and heckling from some of the other candidates could be heard while she delivered her speech.
She said: "Whether you voted for me, voted for other candidates or didn't vote at all , I give you my word , I will be equally strong for each and every one of you."
The by-election result was announced at Cathedral House in Huddersfield at 1.45am.
Turnout for the by-election was 20,567, or 25.78% - one of the lowest by-election turnouts since the Second World War.
The results in full
ANTI, Corbyn – English Independence – 241
BRABIN, Tracy – Labour – 17,506
BUCKBY, Jack – Liberty GB – 220
EDMONDS, Richard – National Front – 87
FURNESS, David – BNP – 548
HIRST, Therese – English Democrats – 969
KHAN, Waqas Ali – Ind – 118
KITCHIN, Garry – Ind – 517
LOVE, Ankit – One Love Party – 34
MAYHEW, Henry – Ind – 153
- Two couples caught having sex in Huddersfield tow0:25
- Location of sex attack, Heckmondwike0:23
- Scene after crash on Sheffield Road near Holmfirth0:34
- Eorl Crabtree learns how to cheerlead at Dalton S0:38
- Sir Patrick Stewart hosts Logan premiere for Hudd0:39
- Lindley Infant School lollipop patrol campaign1:08
- Jason McCartney questions Jeremy Hunt in House of0:49
The Conservatives, Liberal Democrats, Greens and UKIP, all declined to field candidates out of respect for the killing of the former Labour MP in Birstall last June. However but a number of fringe parties, mainly on the hard right, stood candidates to try to gain support in the by-lection.
Jo Cox's husband Brendan tweeted his support for Tracy Brabin as voters went to the polls.
Jo Cox won the safe Labour seat in 2015 with a majority of more than 6,000.
The mother-of-two had been an MP for just over a year when she was shot and stabbed to death on June 16.
Thomas Mair, 53, of Birstall, is charged with her murder, grievous bodily harm, possession of a firearm with intent to commit an indictable offence and possession of an offensive weapon.
His trial is scheduled to begin on November 14.