David Cameron has led the Tories to their first byelection victory in a quarter of a century as a governing party after they easily beat off a challenge from Ukip to hold the safe seat of Newark.
In a significant boost for Cameron, who made four visits to Newark, the Tory candidate Robert Jenrick won with a majority of just over 7,000.
Jenrick, who became the first winning Tory byelection candidate under a Conservative prime minister since William Hague in 1989, secured a comfortable victory with 17,431 votes. The Ukip MEP Roger Helmer came second place on 10,028 votes – a healthy Tory majority of 7,403. Labour came third on 6,842. The turnout at 52.79% was high for a byelection.
The Liberal Democrats suffered a humiliating result as they finished in sixth place behind the Greens and a local hospital campaigner. David Watts won just 1,004 votes, losing his deposit, as the party's vote fell by 17.4 points. Labour and Lib Dem sources said that some of their natural supporters voted tactically for the Tories to keep out Ukip.
The Tory leadership, which ran one of its most energetic byelection campaigns involving four trips by the prime minister to Newark, will use the result to downplay Ukip's recent performance in the European elections. George Osborne is expected to lead the Tory charge on the Today programme on Friday morning where he is due to say that the result shows that voters make serious choices in Westminster elections.
John Curtice, the leading psephologist, cautioned that the Tory result did not necessarily signal a breakthrough. Its vote fell by 8.9 points, slightly lower than the average 10.5% fall in Tory support in byelections in this parliament. The Ukip vote increased by 22.1% while Labour's vote fell by 4.6 points.
Jenrick said that his victory, announced around 3.45am, showed Labour to be in deep trouble. "The people of Newark have voted to back this government - to back this government's long term economic plan to secure the future of this constituency and of this great country.
"Newark elected a Labour MP in 1997. It is clear from tonight's result that the people of Newark believe that Ed Miliband and the Labour party have no answers for the challenges this country faces."
The Tory win did not come as a surprise to the Ukip leadership which had believed that it would struggle to overturn the Conservatives' 16,152 majority at the last election. The byelection was caused by the resignation of Patrick Mercer, who first won Newark in 2001, over a cash-for-questions scandal.
But the scale of the Tory victory is likely to disappoint Nigel Farage, the Ukip leader, who had predicted a Conservative majority of 2,500 at the most. Farage, who had attended a travel conference in Malta in the final days of the campaign, made a brief appearance in the town's Market Square on Thursday afternoon. The Ukip leader had been advised by aides to adopt a low profile on the grounds that his party would struggle in Newark.
Farage failed to secure his main goal: to better the 27.80% it secured when it came second in Eastleigh last year. The Ukip leader told the BBC a few hours before the declaration of the result: "It has been a very short byelection. We couldn't mobilise anybody until after the European elections and so we have really had 10 days at this. The Conservatives have probably put more into this than any byelection they have ever fought in their history. All round I can assure you that the people's army are going to be very happy with this result."
There were worrying signs for the Ukip leadership that female voters declined to support the party. The final Survation byelection poll found that 36.8% of men supported Ukip while just 16.8% of women supported the party. Nearly half of women (47.6%) supported the Tories.
Patrick McLoughlin, the transport secretary, said the Tory victory showed that voters make a serious choice in Westminster elections as he said the result showed his party was well placed for the general election. He told the BBC: "What we have shown today is, when it comes to elections for parliament, people will trust us, people know we are taking very tough decisions but we are seeing employment levels going up and we are seeing confidence that foreign companies are investing in this country.
"In a byelection people are not electing a government. They are expressing a view. For us to win this byelection, 11 months before the general election, gives us very very good progress towards that general election campaign."
Chris Bryant, the Labour frontbencher who ran the party's campaign, played down the significance of the Tory win as he pointed out that Newark is the party's 44th safest seat. Bryant told the BBC: "They threw the kitchen sink, they threw the butler's sink, they threw the crockery, all the silverware, the Aga, the butler, the home help – everything at it."
But John Curtice said Labour's third place raised questions about whether it could win the general election next year. Labour held Newark between 1997-2001 though the boundaries were different.
Curtice told the BBC: "The truth is that they should be on tenterhooks as to whether they will win the seat."
Jonathan Ashworth, the shadow cabinet office minister, said the result showed that Labour needed to do more to put its message across. He said the party also needed to do more to understand the appeal of Ukip.
Full results of the 2014 Newark byelection
Robert Jenrick (C) 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%)
C maj 7,403 (19.13%)
15.46% swing C to UKIP
Electorate 73,486; Turnout 38,707 (52.67%, -18.69%)
Newark results in the 2010 general election
Lib Dem: 10,246
Con majority: 16,152
guardian.co.uk © Guardian News and Media Limited 2010