By William James and Andrew Osborn
ROCHESTER/LONDON (Reuters) - Prime Minister David Cameron's Conservatives lost a second parliamentary seat to the anti-EU UKIP party on Friday, an embarrassing defeat heralding a possible fragmentation of Britain's two-party system in next year's national election.
With distrust of mainstream parties and anxiety about immigration rising, UKIP, the UK Independence Party, overturned a majority of almost 10,000 to beat Cameron's party in a special election in the southeast English constituency of Rochester and Strood six months before an unusually close-run national vote.
UKIP, which favors an immediate British exit from the European Union and sharply lower immigration, won the contest despite Cameron ordering his party to do everything it could to hold the seat and visiting himself five times.
Its victory will unsettle businesses, investors and European partners who fear Britain could be slipping toward an exit from the European Union as Cameron becomes ever more Eurosceptic to try to see off the threat from UKIP.
Comments by Mark Reckless, UKIP's winning candidate, won't steady those nerves.
"If you believe that the world is bigger than Europe, if you believe in an independent Britain then come with us and we will give you back your country," Reckless told clapping supporters after his victory.
Nigel Farage, UKIP's leader, said the vote showed it would be much more difficult to forecast who would govern the world's sixth largest economy in future.
"It is now unpredictable beyond comprehension," he told BBC radio after celebrating with a pint of beer, a drink he has used to portray himself as being in touch with ordinary voters.
Cameron's right-leaning Conservatives and the opposition left-wing Labour Party have taken turns to rule Britain since 1945, with a much smaller party, the Liberal Democrats, playing a supporting role in government since 2010.
UKIP's challenge to the Conservatives and a simultaneous Scottish nationalist threat to Labour could force much more complicated alliances after the election in May.
SETBACK FOR CAMERON
Reckless was a Conservative lawmaker until he became the party's second member of the lower house of parliament to defect to UKIP, triggering Thursday's vote. His new party hopes his electoral success will spur other defections.
He won 16,867 votes or just over 42 percent of the vote, giving him a majority of 2,920. That was less than polls of voter intentions had suggested but a comfortable win.
Cameron's Conservatives, who won the seat in 2010 with a majority of almost 10,000, came second with 13,947 votes even though they had initially been very bullish about victory.
Labour came third with 6,713 votes. It had hoped the result would focus media attention on Cameron's woes. But instead it found itself on the spot after Emily Thornberry, the party's top legal expert, tweeted a photograph of a voter's home draped in England's national flags with a white van parked outside.
Thornberry's decision to tweet the image was interpreted as mocking by some on the social network and proof her party had lost touch with its working class support base.
She quit Labour's team of potential future government ministers as the issue threatened to overshadow the vote.
UKIP THREATENS ALL PARTIES
The electoral loss is a bitter blow to Cameron's personal authority after he ordered his party to "throw the kitchen sink" at the contest to try to hold Rochester.
He said he was determined to win the seat back at the national election, arguing only a Conservative government could safeguard the country's economic recovery.
Labour is talking up the possibility of a leadership challenge against Cameron from within his own party. There is, however, no evidence that such a challenge is imminent. If it did occur analysts believe Cameron would survive but be damaged.
Labour have their own problems, with polls showing they may be wiped out next year in Scotland, a stronghold for generations, where the separatist Scottish National Party has surged despite losing a pro-independence referendum in September.
Labour controlled much of the Rochester constituency before 2010 and its relatively poor showing could resurrect internal party grumbling about the performance of its leader Ed Miliband.
Cameron once sought to dismiss UKIP as full of "fruitcakes, loonies and closet racists".
But in May, the party won European elections in Britain -- the first time a nationwide vote had not been won by Labour or the Conservatives since World War Two. Last month, it won its first directly elected parliamentary seat after former-Conservative Douglas Carswell defected and won the subsequent by-election.
Cameron tried to neutralize UKIP by promising to renegotiate Britain's EU ties before holding an "in-out" referendum on membership in 2017. But he has yet to spell out exactly what changes he wants or forge strong alliances with EU partners to win them. His strategy has alarmed some EU allies.
Opinion polls show the Conservatives are narrowly behind the opposition Labour party with around 32 percent of the vote nationwide. UKIP currently stand at around 15 percent.
Douglas Alexander, the man coordinating Labour's campaign to win power next year, said UKIP was a problem for all parties.
"The principle fuel in UKIP's tank is more anti-politics than anti-Europeanism," he said. "There's a deep anger in the way that the country's run and who it's run for and people feel shut out of the economy and ignored by politics.
"There is no single policy answer to this, no speech or campaign tactic that can address all of the disengagement that people feel."
(Editing by Philippa Fletcher)