Ukip has its first elected MP after a dramatic night which left the two main Westminster parties licking their wounds.

Douglas Carswell, who defected from the Tories, claimed there had been a "profound change in British politics" after he defeated his former party by a landslide in Clacton.

Ukip leader Nigel Farage said the party was "ripping lumps" out of Labour in its northern heartlands after slashing its majority in Heywood and Middleton.

In Clacton, Mr Carswell said there was nothing we cannot achieve" if Ukip was able to extend its appeal to "all Britain and all Britons".

He won the seat with a majority of 12,404 over the Tory candidate Giles Watling, taking nearly 60% of the vote, increasing both his majority and vote share from those he achieved as a Tory in 2010.

On a 51.2% turnout his 21,113 votes saw him comfortably defeat Mr Watling, on 8,709 votes, with Labour in third place and the Greens pushing the Liberal Democrats down to fifth - losing their deposit.

In his acceptance speech Mr Carswell said the Eurosceptic party, which has campaigned on its policy of tightening controls over the UK's borders, had to ensure it could appeal to all people in Britain, including those from immigrant backgrounds.

"To my new party I offer these thoughts: humility when we win, modesty when we are proved right," he said.

"If we speak with passion, let it always be tempered by compassion. We must be a party for all Britain and all Britons: first and second generation as much as every other.

"Our strength must lie in our breadth.

"If we stay true to that there is nothing that we cannot achieve.

"Nothing we cannot achieve in Essex and East Anglia, in England and the whole country beyond."

Ukip's next target is Rochester and Strood, where Mr Carswell's fellow defector Mark Reckless is hoping to return to Parliament.

Mr Carswell said: "In Rochester as in Clacton I believe voters will reject negative campaigns by old party machines."

He said the Heywood and Middleton by-election, where Labour's majority tumbled from almost 6,000 to just 617, illustrated the party's appeal.

"The idea that we are somehow the Tory party in exile, that myth died this evening. We are a different party that stands for all Britain and all Britons, from disillusioned former Labour voters to people who have given up on politics altogether, every bit as much as for traditional Conservative voters," he told Sky News.

"This is something new, this is something different. The real significance is that result in the north of England. We are part of something that is profoundly different in British politics."

Mr Carswell said despite his defection he remained close to a number of Tory MPs and had received "some nice friendly texts from people in the Cabinet".

In Heywood and Middleton Liz McInnes held the seat for Labour in the contest following former MP Jim Dobbin's death.

On a turnout of just 36%, Ms McInnes won with 11,633 votes, a 40.9% share, defeating Ukip's John Bickley on 11,016, a 38.7% share.

Labour highlighted the collapse in the Tory and Lib Dem vote as reasons for Ukip's strong showing, but the result will lead to further questions about Ed Miliband's leadership.

Backbench MP John Mann said: "The real issue is why so many Labour voters are not bothering to vote. The mantra of 'must work harder' is not sufficient.

"If Ed Miliband does not broaden the Labour coalition to better include working class opinion then we cannot win a majority government.

"Ed Miliband does a lot of listening. Now he needs to do a bit more hearing."

Mr Farage said it was a "completely stunning result in Heywood and Middleton, which proves if you vote Conservative in the North, you get Labour".

He indicated there could be further defections to Ukip in the months running up to the general election - without necessarily forcing a by-election.

"There comes a point where there will be backbench Conservatives, and perhaps some Labour ones too, who will reckon they have got a better chance on a Ukip ticket next year than a Tory or Labour ticket," he told Sky.

"I don't think we are quite at that moment yet."

In her acceptance speech Ms McInnes said: "People here weren't convinced by Ukip - a party of Tory ideas, Tory people, Tory money and Tory values."

But Mr Bickley said: "Labour are in big trouble. This should have been a safe seat. They have thrown everything at it and they have only just scraped home."

He added: "Another couple of days and I would have won this. We would have won a week from now on the back of Clacton."

Tory minister Priti Patel, who is an Essex MP, told Sky that at May's general election people would not vote for "alternative political parties" that "tap into your fears" and dismissed the suggestion of a pact with Ukip.

She said: "The reality is we as a party have to look at this election now and take some lessons and learnings from that, but at the same time as we head into the general election, that election campaign will be about the big issues of the day: who governs our country, who do you want as your prime minister and not about voting for alternative political parties that may actually just tap into your fears, anxieties or concerns on particular issues but don't necessarily have the policy solutions to those issues."