The UK Independence Party scored a sensational victory early this morning when Douglas Carswell became the first MP ever elected under the party’s colours.

He romped home in a by-election in Clacton, in Essex, with 21,113 votes, trouncing his Tory opponent, Giles Watling, who scored 8,709. Labour came third with 3,959, while the Liberal Democrats trailed with a humiliating 483.

In his acceptance speech, Mr Carswell said that if Ukip remained true to its principles, “there is nothing that we cannot achieve, in Essex, East Anglia, in England, and in the whole country beyond – and, yes, next in Rochester.”

Nigel Farage hailed the vote "the best night in UKIP's history" as he warned the Tories and Labour: "We're after you - you have underestimated us", Sky News reported.

The Ukip leader added: "What it shows is that UKIP is now a truly national party. We will now take the people's army of UKIP to the Rochester and Strood, and we will give that absolutely everything we have got."

In Rochester, the Tories face another potentially disastrous by-election after its MP Mark Reckless became the second Tory to defect to Ukip.

The Clacton result was a personal triumph for the former Tory MP who put his future on the line in August when he announced that he was switching parties and resigned his seat to give voters in his Clacton constituency the chance to back him or sack him.

In pictures: The rise of Ukip Show all 8 1 /8 In pictures: The rise of Ukip In pictures: The rise of Ukip 1993: Alan Sked forms Ukip History professor Alan Sked had been active in anti-EU politics for a while beore he founded Ukip in 1993. He resigned from the party after the 1997 election, concerned that it was attracting far-right members, and has been critical of Ukip since. Picture: Reuters Reuters In pictures: The rise of Ukip 2005: Kilroy defects Former TV presenter Robert Kilroy-Silk founded Veritas in 2005, after a failed bid to become leader, and took many of Ukip's elected members with him. But the party slowly lost its popularity and didn't put forward any candidates in the last election. Picture: REUTERS/Kieran Doherty REUTERS KD/RUS In pictures: The rise of Ukip 2010: Farage becomes leader, again Farage had led Ukip from 2006 until 2009, when he stood down to fight against the Speaker, John Bercow, for his Buckingham seat. He failed to win the election and returned to lead the party in November 2010. Picture: REUTERS/Kieran Doherty REUTERS/Kieran Doherty In pictures: The rise of Ukip 2010: Ukip fights for election Nigel Farage was injured in a plane crash on polling day in the 2010 general election, but his party increased its success in the votes. It fielded 572 candidates and took 3.1% of the vote, though failed to win any seats. REUTERS/Darren Staples REUTERS/Darren Staples In pictures: The rise of Ukip 2013: Eastleigh gains Ukip's candidate Diane James got the highest ever number of votes for any candidate from the party, but was beaten by the Liberal Democrats. The surge in support gave Ukip confidence ahead of local and European elections later in the year. Picture: Reuters In pictures: The rise of Ukip 2013: Bloom kicked out Godfrey Bloom, who served as an Ukip MEP from 2004 to 2014, had the whip withdrawn in 2013 after sexist comments and an attack on a journalist. He sat as an independent MEP until 2014, when he ended his term in office. Picture: REUTERS/Luke MacGregor In pictures: The rise of Ukip 2014: European election success Ukip got a higher proportion of the vote than any other party in 2014's European elections, adding 11 new MEPs and taking its total to 24. REUTERS/Luke MacGregor In pictures: The rise of Ukip 2014: Carswell defects Douglas Carswell defected from Ukip at the end of August, and was followed by Mark Reckless at the end of September, who resigned from the Tories amid rumours of many more defections to come. Picture: REUTERS/Toby Melville

Turn-out was 51.2 per cent - unusually high for a parliamentary by-election – a tribute partly to the huge effort that volunteers put into plastering Clacton and its surrounding villages with purple coloured Ukip posters.

Nigel Farage was also cheered by an extraordinary near miss in the previously safe Labour seat of Heywood and Middleton, where Labour’s candidate, Liz McGinnis, hung on by just 617 votes, after a recount. She received 11,633 votes, 40.9 per cent of the total, to Ukip’s 11,016, or 38.7 per cent. For Labour that result was far too close to comfort, in a seat they held with a majority of 5,971 in 2010. The result, on a low turn out of just 38 per cent, amounted to an 18 per cent swing from Labour to Ukip, who were a poor fourth in 2010. The by election was caused by the death of the Labour MP Jim Dobbie.

Labour’s Michael Dugher was quick to point out that Labour had increased its share of the vote, and the narrowness of the result came from the collapse in Conservative and Lib Dem support – but the increase was less than one per cent and cold comfort on a night when Labour was vividly reminded that Ukip is now corroding the vote in its northern strongholds. Nigel Farage took to twitter to publicise his new slogan aimed at winning over those who normally vote Tory in the north – “vote Tory, get Labour.”

By taking 38.7 per cent of the vote in Heywood and Middleton, Ukip achieved what was up to that moment their best result ever in a parliamentary by-election - though that record lasted for just an hour while the Clacton count was completed.

Losing Clacton is a blow for the Conservatives, who saw their share of the vote fall to around a fifth of the total, down from 53 per cent of votes cast when Carswell was their candidate in 2010. The early indication was that the Liberal Democrats had lost their deposit.

During the day, the Conservatives tried to gain political advantage from the fact that Mr Carswell was unable to vote, despite posing for photographers outside a polling booth, because he lives outside the constituency boundary. The Tory candidate, Giles Watling is a local councillor.

The Tories will put up a desperate fight to hold onto Rochester and Strood, against Mark Reckless. Privately, Conservative party managers had accepted that Clacton was lost, but are hoping they can halt Ukip’s relentless rise by holding on to Rochester. Two Ukip by-elections victories in quick succession would seriously interfere with the message the Tory want to send their natural supporters at next year’s general election – that supporting Ukip is a wasted vote because their candidates have no hope of being elected and defecting to them only helps Labour.