Cameron: Newark win shows economic message hitting home
David Cameron has hailed the Conservatives' comfortable victory in the Newark by-election as a "very good" result for the party.
The prime minister said the party's "clear message" about the economy had helped it see off the challenge of UKIP, which came second, and Labour.
But he conceded his party must do more to win back votes from UKIP after its majority was cut by nearly 10,000.
UKIP said it had done well to poll 25% and was on course to win seats in 2015.
The victory is the Conservatives' first in a by-election while in government since 1989.
Their candidate Robert Jenrick won the seat with 7,403 votes to spare but the party saw its majority slashed from the 16,152 his predecessor Patrick Mercer got at the last general election.
UKIP's Roger Helmer came second with 10,028 votes, ahead of Labour's Michael Payne in third with 6,842 votes. However, it was a dire result for the Lib Dems, who were beaten into sixth place.
Speaking in Normandy, where he is attending events to mark the 70th anniversary of D-Day, Mr Cameron said the party had managed to do so something it had not done for 25 years.
"By-elections are notoriously tricky," he said.
"It is a good result because we worked hard, we had an excellent candidate, we had a very clear message about our long-term economic plan - how it is working but how we need to stick at it and deliver for everyone in Britain."
The resignation of Newark's former Conservative MP Patrick Mercer, who quit over a cash-for-questions scandal, had raised expectations in UKIP - on a high from their recent European election victory - that they could cause a major upset by winning their first seat at Westminster.
But the Conservatives flooded the seat with MPs in the run-up to polling day - with David Cameron visiting the Nottinghamshire market town four times - in their bid to retain what was, in theory, a safe seat.
Chancellor George Osborne said the Conservatives had got more votes than UKIP and Labour combined, describing the opposition's performance as "disastrous".
"We can take some comfort from this result but we know, of course, that the job is not done," he told BBC Radio 4's Today programme.
"We have to get out there and take our message to the other constituencies over the coming year."
The BBC's Deputy Political Editor James Landale writes: UKIP promised an earthquake but Newark was struck by only a minor tremor. Their wait for a foothold in Westminster continues. And here is the interesting point: both the Lib Dems and Labour said that anecdotally some of their supporters had voted Conservative tactically to keep UKIP out. It is impossible to know how many until some detailed polling is done. But it suggests that an anti-UKIP backlash is out there, a kind of protest vote against a protest vote.
UKIP said it had retained 85% of the support it had won in last month's European elections and it augured well for its performance in next year's general election.
"It is not a question of what went wrong but a question of what went right," Mr Helmer told BBC Radio 5 Live.
"This shows a trend in the right direction. Traditionally, for many years now we have seen UKIP do very well in European elections and then collapsing to 4% or 5% in Westminster elections.
"Here there was a bit of a retreat... but nothing like the collapse of UKIP support that the (other) parties have been counting on."
Senior Labour figures have been reluctant to comment on their parties' performances, with Ed Miliband declining to answer questions while attending D-Day commemoration events in France.
Labour have bridled at Conservative suggestions that it should have done better in a seat it won in 1997, saying boundary changes since then mean no comparisons can be made.
And the Lib Dems have blamed tactical voting after they got 2.6% of the vote and were beaten by the Greens and an independent candidate.
Treasury Minister Danny Alexander suggested that some Lib Dem supporters turned to other parties "to keep UKIP out", adding that he "completely understood" their reasons.
But John Pugh, one of their MPs, said he was "baffled" his party had not fought the campaign harder and called for a shake-up of its electoral strategy.
Newark by-election: result in full
Robert Jenrick (Con) 17,431 (45.03%, -8.82%)
Roger Helmer (UKIP) 10,028 (25.91%, +22.09%)
Michael Payne (Lab) 6,842 (17.68%, -4.65%)
Paul Baggaley (Ind) 1,891 (4.89%)
David Kirwan (Green) 1,057 (2.73%)
David Watts (LD) 1,004 (2.59%, -17.41%)
Nick The Flying Brick (Loony) 168 (0.43%)
Andy Hayes (Ind) 117 (0.30%)
David Bishop (BP Elvis) 87 (0.22%)
Dick Rodgers (Stop Banks) 64 (0.17%)
Lee Woods (Pat Soc) 18 (0.05%)
Con majority 7,403 (19.13%)
15.46% swing Con to UKIP
Electorate 73,486; Turnout 38,707 (52.67%, -18.69%)