Far-right groups booed and jeered a newly elected MP as she paid tribute to murdered colleague Jo Cox.
Former Coronation Street actress Tracy Brabin won the Batley and Spen by-election against candidates from independent and fringe parties.
The Conservatives, Liberal Democrats, Ukip and Greens all decided not to contest the seat out of respect for Ms Cox, who was killed days before the EU referendum.
And some of Ms Brabin's opponents opted to heckle her as she gave her acceptance speech, with one shouting "she's a racist".
Ms Brabin, who took almost 82 per cent of the vote, honoured Ms Cox and said winning was "bittersweet".
"This has been a difficult experience for all of us and tonight is a bittersweet occasion for me. That this by-election has had to take place at all is a tragedy," she said.
"I hope Jo will be proud tonight of our community. We have shown that we stand together with one voice choosing unity and hope."
Turnout for the vote was just 25 per cent: one of the lowest for a by-election since the Second World War.
Following her acceptance speech, Ms Brabin told Sky News the heckling "just shows who they are".
"The people of Batley and Spen have given me a mandate but they've [the other parties] lost their deposits.
"I get to work and feel very supported. I feel the people of Batley and Spen behind me."
Asked about the turnout she said: "Well, it's a wet Thursday in October. But I think 85 per cent, or whatever it is, is very good.
"And I feel that the community have said what was for us a tragedy has turned into an opportunity to show hatred and they didn't buy it."
Mrs Cox's widower, Brendan Cox, congratulated Ms Brabin on her victory on Twitter. He also tweeted a picture of he and his wife during the 2015 general election.
He said: "This was Jo at the general election count last year as I briefed her on the numbers. She was calm, serene and full of grace that night."
Meanwhile, another by-election in the safe Conservative seat of Witney in Oxfordshire elected a replacement for David Cameron, who gave up his seat last month.
Register for free to continue reading
Registration is a free and easy way to support our truly independent journalism
By registering, you will also enjoy limited access to Premium articles, exclusive newsletters, commenting, and virtual events with our leading journalists
Already have an account? sign in
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies