Nigel Farage has quit as leader of Ukip after failing in his attempt to win a seat in the House of Commons.

The man who has done far more anyone else to put the anti-EU party on the political map sounded almost relieved as he accepted defeat in South Thanet, which was won by the Conservative Craig Mackinlay, with a majority of 2,808.

“I feel an enormous weight lifted form my shoulders. I have never felt happier,” Mr Farage announced.

He said there would be a leadership election in September and that he will "consider over the course of the summer whether to put [his] name forward" to do the job again.

As the votes were read after a long night’s wait, Mr Farage's defeat was greeted with derisive cries of “Bye Nigel!”.

Mr Farage said there would be a Ukip election in the summer, and that he would take time out from politics to consider whether or not he would put himself forward as a candidate - leaving the door open for a possible return.

Having made his speech, Mr Farage and his supporters hurried out of the hall, without waiting to hear the speeches from other defeated candidates, and gathered in a nearby hotel, where he formally announced his resignation, despite the pleas of senior colleagues who wanted him to stay.

The Conservative Party's Craig Mackinlay waves after winning the count for the South Thanet seat (AP/Matt Dunham)

His departure could result in another of the UK’s political parties being led by a woman. Mr Farage’s deputy, Suzanne Evans is seen as having had a good campaign, and is in pole position to take his place.

Ukip’s only remaining MP, Douglas Carswell, is a free market ex-Tory who would struggle to retain the party’s growing appeal among disillusioned working class voters in Wales and the north of England. Nigel Farage’s defeat in South Thanet was the final disappointment in a disappointing night for Ukip. Because of technicality with the count, South Thanet's result was one of the last constituencies to declare, more than four and a half hours behind schedule.

By then, Ukip knew that Mark Reckless, the other former Tory MP to defect to the party last year, had been defeated in Rochester and Strood, and the party had failed to win seats such as Thurrock and Castle Point, in Essex, on which they had set their sights.

But they had come second in a large number of safe Labour seats in the north and in Wales, and in several safe Conservative seats, accumulating almost four million altogether – four times their tally in the 2010 election.

The major political figures who lost out in the General Election Show all 16 1 /16 The major political figures who lost out in the General Election The major political figures who lost out in the General Election Ed Balls Ed Balls lost his seat in what was the biggest shock of an extraordinary night of election results. His defeat in compounded Labour's woes in a dismal night, which saw the party lose all but one of its Scottish MPs and will undoubtedly lead to Ed Miliband standing down. The major political figures who lost out in the General Election Nigel Farage OK, so he came close to being upstaged by a professional comedian – Al Murray aka the Pub Landlord, had also lost in South Thanet. But as he lost his fight to become an MP and resigned his Ukip leadership, Nigel Farage did manage to get in a few gags. He began by railing against the editors of the The Sun and the Daily Mail, sarcastically calling them “geniuses”. But perhaps bearing the last election in mind, when he was in intensive care following an air crash, he said after the result that he felt “pretty good”. “Never felt happier,” in fact. A weight lifted off the old shoulders. Quite right too, old boy. More time for the saloon bar and a pint, or five. AFP/Getty Images The major political figures who lost out in the General Election Vince Cable A huge scalp for the Conservatives, even though he was part of their coalition government. The Liberal Democrat Business Secretary lost his Twickenham seat to Tory candidate Tania Mathias. Cable had held the seat since 1997 and was a strong figure in the Lib Dems, having previously been deputy leader. Christopher Furlong | Getty Images The major political figures who lost out in the General Election Jim Murphy A sign of how dire things are in Scotland now for the Labour party. The leader of the Scottish Labour Party, Jim Murphy, lost his Renfrewshire East to the SNP, having held the seat since 2005. He held a number of cabinet positions under the administrations of Tony Blair and Gordon Brown. Jeff J Mitchell | Getty Images The major political figures who lost out in the General Election Danny Alexander The Chief Secretary to the Treasury and Nick Clegg's right-hand man, Danny Alexander, lost his seat of Inverness, Nairn, Badenoch and Strathspey to the SNP. His aides admitted defeat several hours before the formal decision was due. There were suggestions that the SNP vote could be as high as 50 per cent. BEN STANSALL | AFP | Getty Images The major political figures who lost out in the General Election Esther McVey The Minister of State for Employment and one of the few women in David Cameron’s male-dominate cabinet, Esther McVey had only held Wirral West since 2010. Her 2,436 majority was overturned and Labour's Margaret Greenwood won the seat with a 417 majority. BEN STANSALL | AFP | Getty Images The major political figures who lost out in the General Election George Galloway The former Labour MP had held the seat of Bradford West since 2012 for the Respect Party. He previously held the constituency of Bethnal Green and Bow for Respect between 2005 and 2010, although he unsuccessfully contested Poplar and Limehouse in 2010. Nigel Roddis | Getty Images The major political figures who lost out in the General Election Charles Kennedy Another huge Lib Dem scalp, with the SNP taking the seat of Ross, Skye and Lochaber from the former leader of the party. Kennedy had led the Lib Dems between 1999 and 2006 and had become something of an elder statesman of the party. He conceded defeat ahead of the official declaration and said he would not give any TV interviews. He had been an MP since 1983. Jeff J Mitchell | Getty Images The major political figures who lost out in the General Election Douglas Alexander The shadow Foreign Secretary and Ed Miliband's Chair of General Election Strategy, Danny Alexander had been the MP for Paisley and Renfrewshire South since 1997. He lost his seat to the SNP, with the party now holding a 9,076 majority. Labour's share of the vote was down by 21.3 per cent. Jeff J Mitchell | Getty Images The major political figures who lost out in the General Election Simon Hughes Simon Hughes held a key Liberal Democrat seat in London, Bermondsey and Old Southwark, which he held from 1983. Hughes is a former deputy leader of the Lib Dems and had been minister of state at the Ministry of Justice since 2013. He was previously the President of the party, as well as a two-time leadership candidate, and stood for the party in the 2004 Mayoral election. Rob Stothard | Getty Images The major political figures who lost out in the General Election Mark Reckless An MP for Rochester and Strood since 2010, Reckless switched from the Conservatives to Ukip in September 2014 and winning the seat outright in November. He was the second Ukip MP after Douglas Carswell, and his loss is a huge blow to Nigel Farage’s party. Carl Court | Getty Images The major political figures who lost out in the General Election Margaret Curran Margaret Curran had held Glasgow East since 2010 and was the shadow Secretary of State for Scotland. She had previously been the MSP for Glasgow Baillieston (a seat she might wish she still held, as it is still held by Labour under the title Glasgow Provan). Jeff J Mitchell | Getty Images The major political figures who lost out in the General Election David Laws A Liberal Democrat MP for Yeovil since 2001, he was the minister of state for Schools. He had briefly been Chief Secretary to the Treasury after the 2010 election, only holding the office for 17 days after resigning due to the disclosure of his Parliamentary expenses claims. Laws was a key negotiator for the Lib Dems when the coalition was being formed five years ago. Jeff J Mitchell | Getty Images The major political figures who lost out in the General Election Jo Swinson On her election in 2005, she was the youngest member of the House of Commons. Under the Coalition government, the Lib Dem MP was the Under-Secretary of State for Employment Relations, Consumer and Postal Affairs and for Women and Equalities. She lost her seat of East Dunbartonshire to the SNP's John Nicholson. Matthew Lloyd | Getty Images The major political figures who lost out in the General Election Ed Davey The Liberal Democrat Energy and Climate Change Secretary Ed Davey had been the MP for Kingston and Surbiton since 1997. Davey championed the Lib Dems' role in ensuring the Conservative-led Coalition championed the green agenda. However, the well-known Lib Dem MP lost his seat to the Tories, having held the seat in 2010 by 7,560 votes. Jeff J Mitchell | Getty Images The major political figures who lost out in the General Election Lynne Featherstone Lynne Featherstone lost her London seat of Hornsey and Wood Green to the Labour party. She was a former junior Home Office minister with responsibility for equality, then becoming junior minister with responsibility for international development. Dan Kitwood | Getty Images

The fact that a party could win so many votes but so few seats is an illustration of the pitfalls of the ‘first past the post’ electoral system. Mr Farage called for “real, genuine radical political reform” to address that anomaly – suggesting that the proportional representation is likely to become a Ukip battle cry in future.

The South Thanet result came as a shock to Ukip activists who had put their faith in a Survation poll carried out in the constituency, which gave Nigel Farage a comfortable nine percentage point lead. That poll appears to have contributed to the Ukip leader’s defeat, because – as one Tory campaigner put it – “it frightened the horses” and galvanised Conservative campaign headquarters into sending three experienced professionals to South Thanet to help their candidate, Craig Mackinlay.