Clegg defiant despite Lib Dems' slump in Barnsley poll
Nick Clegg has said people should not "write off" the Lib Dems despite the party slumping to sixth place in the Barnsley Central by-election.
The party finished behind UKIP, the BNP and an independent as its share of the vote dropped to just over 4%.
Labour, which won the poll on a 36% turnout, said voters had sent a "very clear message" to Mr Clegg about their dislike of his role in the coalition.
But the Lib Dem leader said the party would prove its critics wrong.
The Lib Dems slipped from second place in last year's general election to sixth place in Thursday's poll - which was triggered by the conviction of the constituency's former Labour MP for expenses fraud.
According to BBC Research, it is the biggest drop, in terms of ranking, at an English by-election since 1945.
Labour held the seat with a slightly increased majority of 11,771, with UKIP doubling the share of the vote it gained in May to beat the Conservatives into third place - one of the eurosceptic party's best-ever by-election results.
Turnout in the by-election fell to 36.5%, compared with 56.4% at the May 2010 poll.
Mr Clegg said it was "obviously a bad result" for the Liberal Democrats, whose share of the vote fell from 17.2% last year to 4.1% and whose candidate lost his deposit.
"In truth it was a no contest for any non-Labour candidate," he said.
"It was a very safe Labour seat. Labour got a huge majority on an abysmally-low turnout and everybody else was left to pick up the pieces."
But the Lib Dem leader was defiant about his party's long-term fortunes and its continued alliance with the Conservatives in the coalition government.
"I have no doubt people will try to use this single result to write off the Liberal Democrats. They have done it in the past and we have proved them wrong and we will prove them wrong again.
"In government, nationally, we will continue to do what I think is absolutely vital for the long-term benefit of the country. Namely sort the economic mess we inherited from Labour for the long-term benefit of Britain."
Labour leader Ed Miliband said the victory of the party's candidate Dan Jarvis, a 38-year-old former soldier who served in Afghanistan and Iraq, was "fantastic" and accused the Lib Dem leader of complacency.
"I don't think you should write off the people of any part of Britain," he said. "They have sent them a very clear message. They don't like the fact that he is part of a Conservative-led government which is betraying the hopes of the next generation of people in this country, that is squeezing living standards and frankly breaking a lot of the promises he made at the general election.
"I urge Lib Dems to come and work with Labour, either by joining Labour or by working with us against the direction of this Conservative-led government."
The by-election is only the second since the coalition government took power last May, with Labour also winning the previous contest in Oldham East and Saddleworth in January.
BBC political correspondent Ross Hawkins said the result would be a real concern for the Lib Dems ahead of May's English council elections although it remained to be seen whether the slump in their support was a one-off or a sign of a wider trend.
UKIP leader Nigel Farage heralded the party's performance, saying they were the "real winners" in Barnsley Central.
"We've shown our potential in European elections by getting big scores in the past and now we're doing it in first past the post Westminster elections," he said. "We are delighted though I have to say but not completely surprised.
"Because just over the last month, whether it's votes for prisoners, car insurance for young women, annuities for old men, increasingly our Parliament is seen to be completely impotent. So the UKIP message that we should take back control of our own lives is very relevant to voters."
For the Conservatives, Chancellor George Osborne said Labour's victory was not a turn-up given their historic dominance of the area and the Barnsley seat was "never within our sights".
"The Conservatives started out in third place and ended up in third place," he said.
Former MP Eric Illsley held Barnsley Central with a majority of just over 11,000 in last year's general election but he resigned his seat after pleading guilty to falsely claiming £14,000 in parliamentary expenses. He was later jailed for a year.