David Cameron has insisted the Tories can "win people back" after a disastrous result in the Eastleigh by-election saw the party beaten into third by UKIP.
The Prime Minister attempted to shrug off the severe blow by calling a huge surge in support for the eurosceptic party a mid-term "protest".
"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," he said.
But the terrible result in a constituency which is among the Conservatives' top targets to win back from the Lib Dems will increase fears of defeat in 2015.
Lib Dem local councillor Mike Thornton managed to hold the seat vacated by disgraced Cabinet minister Chris Huhne despite a torrid week for his party.
At 1,771, the Lib Dem majority was less than half that achieved by Mr Huhne in 2010 but the victory was still seen as a major boost for the coalition's junior partner.
Nick Clegg said the "stunning" result proved "we can be a party of government and still win".
"We held our nerve, we stood our ground. We overcame the odds and won a stunning victory," he said, standing alongside Mr Thornton in the constituency.
The Conservatives' third place, which was despite major campaigning by senior figures, will increase tensions on the backbenches and at the grass roots.
There will be concern that Mr Cameron's pledge to hold a referendum on EU membership if the Tories stay in power has not curbed UKIP's rise.
The eurosceptic party's candidate Diane James polled 11,571, not far behind Mr Thornton on 13,342 and more than 1,000 ahead of Tory Maria Hutchings.
The Tory's 10,559 votes or 25.4% share represented a slump of 14 points on her result against Mr Huhne in 2010.
Polling by Tory peer Lord Ashcroft , who recently withdrew his support from the party, suggested 22% of Tory voters and 19% of Lib Dem voters in 2010 switched to UKIP.
Almost half, 43%, of UKIP voters said they would probably vote the same way in 2015 - with 10% saying they would back the Tories and 34% saying they were not sure.
Only 43% of Lib Dem supporters said they would stick with them in 2015, with 13% going to Labour and 7% to the Tories, according to his survey of 760 voters.
In his victory speech, Mr Thornton said his victory proved those who had "written off" the Lib Dems were wrong.
"Those who say the Liberal Democrats won't win again, those who are so keen to do us down, that the Liberal Democrats can do it - we have done it and we will do it again," he said.
Lib Dem president Tim Farron warned there were 20-30 Tory seats that his party might feel it could snatch in 2015.
"Defeat by a single vote would have been unspeakable catastrophe and a win by a single vote would have been unspeakable triumph, so this is unspeakable triumph and it means everything to the Liberal Democrats," he said.
"The narrative that we are written off and we can't win anything and we are going down the plughole in 2015 is now, I think, completely confounded - there's a lot of people with egg on their faces this morning.
"The morale and energy boost it will give Lib Dems up and down the country is just priceless."
Ms James called her second place "a humungous political shock" that represented a "seismic shift" in British politics, while Mrs Hutchings appeared to be tearful as she thanked opponents for a "clean campaign".
Delighted UKIP leader Nigel Farage blamed the Tories' bad showing on Mr Cameron.
"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'," he said.
"He's talking about gay marriage, wind turbines, unlimited immigration from India. He wants Turkey to join the European Union. The Conservatives' problems are not because of UKIP, it's because of their leader."
Eastleigh is on a Tory target list of 20 Lib Dem-held seats considered crucial to win if Mr Cameron is to win outright at the next general election.
Senior Tory backbencher David Davis had already warned the Prime Minister that third place in the seat would represent a "crisis" for the party.
Conservative Party chairman Grant Shapps tried to play down the significance of the result, saying: "Governments in mid-term regardless get a drubbing. Let's wait until the general election."
Education Secretary Michael Gove said he was "deeply disappointed" but insisted the Tories must not change track on the economy or shift to the right.
Labour leader Ed Miliband called it a "disastrous night for the Conservatives and David Cameron" but also admitted he would have preferred to win more votes.
"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," he said.
Calculations by the Press Association suggest Labour would have a majority of 60 if the vote share changes were repeated nationally at a general election.