Conservative candidate Maria Hutchings, who came third, decided not to speak to reporters after the count at Eastleigh - and the result was an almighty scrum.
Interviews with the winning Lib Dem candidate, Mike Thornton; Nigel Farage, UKIP leader; George Hollingbery, Conservative MP for Meon Valley; and John Denham MP, Southampton Itchen.
This is how the share of the vote looked for the four main candidates:
- Mike Thornton (Liberal Democrat) - 32.1%
- Diane James (UKIP) - 27.8%
- Maria Hutchings (Conservative) - 25.4%
- John O'Farrell (Labour) - 9.8%
- Other - 4.9%
The Conservative candidate Maria Hutchings has refused all interviews and left the building by a side entrance amidst a media scrum.
Mike Thornton and Diane James have a chat after the declaration.
The UKIP leader Nigel Farage has said he believes his party would have won given another week of campaigning, pointing out that UKIP did better in votes cast today as opposed to postal votes.
He told Sky News: "No-one can ever say that a vote for UKIP is a wasted vote. We're getting nearer and nearer."
The Liberal Democrat candidate won with a majority of 1,771 results, down from the 3,864 majority in 2010.
The UKIP candidate Diane James has thanked voters in Eastleigh for delivering a "humungous political shock".
She said she hoped the result would mean that UKIP is no longer excluded from mainstream media coverage.
Here are the results for the main four candidates in the Eastleigh by-election:
- Mike Thornton (Liberal Democrat) - 13,342
- Diane James (UKIP) - 11,571
- Maria Hutchings (Conservative) - 10,559
- John O'Farrell (Labour) - 4,088