A hand grenade has been thrown into David Cameron's general election campaign after the Eurosceptic Tory MP Douglas Carswell defected to Ukip, triggering an early byelection.

A leading member of the new generation of Tory Eurosceptics who has campaigned openly for a British exit from the EU, Carswell said he had endured sleepless nights in the runup to his decision, which was prompted by the prime minister's failure to deliver change in the EU.

Carswell indicated he would shortly resign as MP for Clacton, Essex, guaranteeing a difficult byelection for the Tories. As the sitting MP, Carswell will have an immediate advantage in a seat described by the academic Matthew Goodwin as the most Ukip-friendly area in the country. It is the first time since 1982 that an MP has resigned their seat to fight a byelection on behalf of another party.

Criticising the Tories for failing to deliver change, Carswell said: "They are not serious about real change. It's above all the failure to deliver on the promise of political reform that has driven me to be here today.

"Europe's the one continent on the globe that is not growing … yet who in Westminster, who among our so-called leaders, is prepared to envisage real change?"

William Hague, the leader of the Commons, led an immediate Tory fightback against Carswell as he declared that his former colleague's defection would make an EU membership referendum less likely by increasing the chances of an Ed Miliband victory.

Hague told The World at One on BBC Radio 4: "It is a regrettable thing and it is a totally counterproductive thing to do because the only chance of real change in Europe, the only chance of having a referendum where people can decide to stay in the EU or leave the EU is having a majority Conservative government at the election next year. Anything that makes that more difficult damages the chances of change in Europe or the people in this country having their say."

But Nigel Farage, who unveiled his new party member at a Westminster press conference after secretive negotiations, said he expected further defections. Farage told The World at One: "We have talked to Tory and Labour MPs over the course of the last six months who very very strongly support everything Ukip is trying to do. The real answer to [the] question – how many others – will all depend on this byelection. This byelection is going to be a High Noon moment."

Carswell's announcement hands the prime minister a major pre-election headache on the eve of the return of parliament from its summer recess. Ukip will receive wall-to-wall coverage in the runup to the byelection, where it will start as the favourite in a seat where Carswell had a majority of 12,068 at the last general election.

Carswell's move may also encourage other Tories to jump ship. Eurosceptic Tories who remain in the party may feel emboldened to challenge the PM, possibly by declaring in their general election addresses that they would campaign to leave the EU in the referendum planned by Cameron in 2017.

Carswell said he had welcomed the prime minister's EU speech in January last year, in which Cameron pledged to hold an in/out referendum on Britain's EU membership by 2017. He said: "No one cheered DC's Bloomberg speech more loudly than me … but there's been nothing since. They haven't thought it through. There is a world of change and opportunity out there. Ministers are simply not up to giving us the kind of realignment we need.

"I've had more sleepless nights than you can possibly imagine. I am standing here precisely because I know that neither side wants real change [on the EU]. Ed Miliband has been honest enough to say he doesn't want real change. The Conservative leadership is not serious about change … David Cameron has made up his mind that he wants to stay in."

Carswell, who voted for Cameron in the 2005 leadership contest, said he had no personal difficulties with the PM. "I happen to like David Cameron – I am not expecting him to now reciprocate my feelings. He is fun, he is a likeable person. He is a nice, decent person. He is just not serious about the change we need."

Sitting alongside Farage, Carswell joked about his record as a rebellious Tory MP. "It's nice to have a leader with whom I agree." Farage joked: "It is early days though."

The Ukip leader praised Carswell for his bravery as he became the first MP since the late Bruce Douglas-Mann in 1982 to resign a parliamentary seat in order to trigger a byelection where he will stand for another party. Farage said Carswell had made the "bravest and most honourable" decision he had seen in British politics. It is unclear when the byelection will be held. Carswell did not say when he would be resigning his seat. The writ for any byelection would be moved by the Tories.

The defection of Carswell will not cause great surprise in Tory circles, but his decision will fuel fears that the party may be heading for an historic split on Europe. Some senior Eurosceptics have said the party will undergo its most damaging split since the Corn Laws of the mid-19th century if the prime minster holds his in/out EU membership referendum.

Miliband tweeted: "Douglas Carswell's defection is not just a blow to David Cameron. It shows the Tory Party too divided to stand up for hard-working families."

Carswell is respected across the board at Westminster for the clarity of his thinking. He is a strong supporter of greater transparency in politics and has campaigned for parliamentary candidates to be selected in open primaries and for a power of recall of MPs to be introduced. He says his stance on EU withdrawal developed out of a belief the organisation is run by unaccountable and undemocratic institutions.

On Tuesday, Farage was selected to fight the Conservative-held seat of South Thanet in Kent at next May's general election.

Douglas Carswell: the frequent Tory rebel

Photograph: Paul Grover/Rex Features

Douglas Carswell MP Photograph: Paul Grover/Rex Features A frequent Tory rebel on Europe, Douglas Carswell first stood for parliament in 2001 against Tony Blair, as the Conservative candidate for Sedgefield. He apologised for coming second, but managed to cut Blair's majority by over 7,500 votes.

The Clacton MP entered parliament in 2005 and helped write a publication, Direct Democracy: an Agenda for a New Model Party. The publication was described by the Spectator as being "one of the founding texts of the new, revitalised Toryism", which had "argued compellingly that the party should embrace radical localism".

A number of ideas outlined in it have since become mainstream Conservative thinking; the call for directly elected police chiefs is now party policy and the use of open primaries to select party candidates. Carswell, often described as a libertarian, gained notoriety at Westminster when he led a campaign to remove Michael Martin, then the Speaker of the House, for a failure to ensure greater transparency on how the Commons is run. In December 2009, Carswell introduced a bill requesting a public referendum on British EU membership. During the 2009 expenses scandal, the Daily Telegraph revealed he had claimed among other things a £655 "love seat" and had flipped his second home.

He lived up to his law and order credentials by turning crimefighter in his own constituency in January, breaking the news on Twitter. "Just chased and caught a shoplifter in Clacton … waiting for police." Seven minutes later, he tweeted again: "Police response time pretty effective. Arrested. Now off to my advice surgery." Carswell later explained: "I was in the centre of Clacton going from one constituency appointment to the next as MPs do on a Friday. I heard someone shout and saw someone trying to run away. There was a store detective shouting at them."

Born in 1971, Carswell grew up in Africa where his parents worked as doctors among some of the world's poorest people. His father, Wilson Carswell, a fellow of the Royal College of Surgeons, diagnosed the first cases of HIV/Aids in Uganda in the early 1980s. Carswell went to St Andrew's School, Turi, in Kenya and then Charterhouse in the UK. He read history at the University of East Anglia and at King's College, London. Before politics, Carwell worked in television and then investment management. He also worked in the Conservative party's policy unit, run by David Cameron.