In quotes: Eastleigh by-election
The Liberal Democrats have won the Eastleigh by-election, with the UK Independence Party pushing the Conservatives into third place. Here is a selection of responses to the result.
Prime Minister David Cameron, Conservative
"What we have got to do is deliver for people who work hard, who want to get on, and deliver on the agenda that they care about and I care about. That means getting our economy moving, it means continuing to reduce our deficit, it means continuing to cut immigration, it means continuing to reform welfare, it means delivering for people who work hard, who want to get on, who want to do the right thing for their families.
"That is my agenda, that is their agenda. This is a by-election, it's mid-term, it's a protest. That's what happens in by-elections. It's disappointing for the Conservative Party but we must remain true to our principles, true to our course, and that way we can win people back."
Deputy Prime Minister Nick Clegg, Lib Dem
"This has been a by-election we've had to fight in exceptionally difficult circumstances. Our opponents have thrown everything at us. We held our nerve, we stood our ground, we worked as a team, we went out and campaigned on every doorstep, we overcame the odds and won a stunning victory.
"For the Liberal Democrats, my view is the message is very simple: we can be a party of government and still win.
"That's what we proved last night and we proved it because we showed the people of Eastleigh... how we are delivering for them and their families, not just locally but nationally too."
Opposition leader Ed Miliband, Labour
"Clearly I would have preferred to have got more votes than we did, but this was always going to be a tough fight for Labour - it's a seat that we've never won.
"It convinces me that we need to redouble our efforts to reach out to every part of the country, including areas where Labour hasn't traditionally been strong.
"This was a disastrous night for the Conservatives and David Cameron. What we want to hear from the prime minister is a recognition that people are deeply unhappy with the direction of the country and he's going to listen."
UKIP leader Nigel Farage
"People will say it was a protest vote, but who we attracted here were non-voters who had not voted for 20 years - they are not protest votes.
"If the Conservatives hadn't split our vote we'd have won, wouldn't we? The Conservatives failed here because traditional Tory voters look at Cameron and they ask themselves: 'Is he a Conservative?' And they conclude 'No, he's not'."
Mike Thornton MP, winning Lib Dem candidate
"The people of Eastleigh recognise that the Liberal Democrats have always had a superb record of delivery, we've always listened to what people want, and we always make sure that we do a good job."
John O'Farrell, Labour candidate
Tweeted: "Had hoped more would switch from Lib to Lab. Some did, but as many of ours went to UKIP. Lab % share up slightly. Result feels OK in context."
"Weirdly 4th would have felt worse if the Tories had come 2nd. But it was UKIP's night. Still too many voters angry with all politicians."
Eleanor Laing MP, Conservative backbencher
"Ordinary Conservative voters don't feel that this government is in tune with them, with their hopes and fears. It's hurtful to people who want to believe in a Conservative Party that represents them.
"The only way to take forward those issues that people really care about is to have a truly Conservative government. And to do that the leadership of my party has to tune in better to the people who want to support it - who want loyalty and who now feel rather left out.
"Loyalty is a two-way thing and the leadership of the Conservative Party asks for loyalty from our supporters but those supporters don't feel that they're getting loyalty back."
Douglas Carswell MP, Conservative backbencher
"There are some policy lessons to be drawn. Oddly enough, I have to say I don't think Europe is the issue... I would like us to do far more to focus on the bread and butter issue of cost of living. I think living standards are declining.
"We talk about only a protest vote, one of the reasons why people feel inclined to protest is because they are hurting in their pocket. What is it that's happened that's allowed us to go on this long retreat, this long march of defeat?"
Lib Dem president Tim Farron
Mr Farron said the result represented a "turning point in this Parliament" that would "strengthen our hand very much within coalition in the run up to the Budget".
He said it left the Lib Dems in "a very strong position to start gaining seats from the Conservatives", adding: "Without a single doubt at all the party is united behind Nick Clegg. There is no crisis in his leadership."