Labour has won the Hartlepool by-election with a reduced majority, as the Conservatives were beaten into fourth place.
Labour candidate Iain Wright was 2,033 votes ahead of the Lib Dems
Victorious Iain Wright secured 12,752 votes - 2,033 ahead of Jody Dunn of the Liberal Democrats, on 10,719.
Stephen Allison, of the UK Independence Party, received 3,193 votes, 149 more than Conservative Jeremy Middleton.
The election was caused by the resignation of Peter Mandelson, who held a 14,571 majority for Labour.
He left his seat to become a European Commissioner.
During the 2001 general election, the Conservatives came second to Labour with the Liberal Democrats third and the Socialist Labour party fourth.
Ms Dunn, a family lawyer, had purple powder thrown over her as she took to the podium to thank her supporters.
BBC News Online's Chris Hamilton, in the hall, said she looked visibly distressed.
Fathers 4 Justice candidate Paul Watson was arrested over the incident and released on police bail. He is due to be questioned later this month.
HARTLEPOOL BY-ELECTION RESULTS
1-Iain Wright (Labour) 12,752
2-Jody Dunn (Lib Dem) 10,719
3-Stephen Allison (UKIP) 3,193
4-Jeremy Middleton (Conservative) 3,044
5-John Bloom (Respect) 572
6-Iris Ryder (Green) 255
7-James Starkey (NF) 246
8-Paul Watson (F4J) 139
9-Christopher Herriot (Socialist Labour) 95
10-Richard Rodgers (Common Good) 91
11-Philip Berriman (Ind) 90
12-Alan 'Howling Laud' Hope (Monster Raving Looney) 80
13-Ronnie Carroll (Ind) 45
14-Edward Abrams (English Democrats) 41
Mr Wright, a local councillor, was subjected to raucous jeering as he made his victory speech.
He said: "Tonight's result is great news for Tony Blair, a huge disappointment for Charles Kennedy and an absolute disaster for Michael Howard.
"I have always been proud to come from Hartlepool but I have never been prouder than tonight."
The victory, at a difficult time for the government, was a "ringing endorsement" of Labour's policies, he added
Mr Mandelson said in a statement: "Iain Wright will be a first rate MP and he could not wish for better constituents."
In contrast, the result will be seen as a huge blow to the Conservatives, whose party conference begins this weekend.
Shadow work and pensions secretary David Willetts said: "This is very disappointing. There is no point in pretending otherwise.
But Mr Willetts said his party's fortunes would improve at the next general election and ruled out a change of leader.
Commons Leader Peter Hain told BBC News 24: "It is terrific news for Tony Blair in a week when actually he has been hammered in the newspapers and by the
Lib Dem candidate Jody Dunn was covered in purple powder
"Of course, he and his family are now very concerned about the procedure on Friday, as we all are. We are thinking of him. It is great news for him.
"The main news tonight is an absolute catastrophe for the Conservative Party and for Michael Howard, who has simply shown he is not taking them anywhere."
Mr Wright has been celebrating the win with his supporters in an open top bus tour of the North East town.
Labour went into the by-election with a 158-seat majority in the House of Commons, with 406 seats, against 163 for the Conservatives.
The turnout in Hartlepool was just under 46%, compared with 56% at the 2001 general election.