LONDON (AP) — David Cameron’s Conservatives took a drubbing in local elections amid a surge of support for an anti-European Union and anti-immigration party, heaping pressure on the prime minister to appeal to the dissident right-wing of his own party.

Echoing results across Europe, British voters appeared to punish the ruling government, fed up with economic doldrums and austerity measures. Britain’s nationalist party appeared to be the recipient of a sizeable protest vote against the political elite and the EU, analysts said.

According to incomplete returns from 34 contests across England, the right-wing United Kingdom Independence Party, or UKIP, won 76 county council seats, while the mainstream opposition Labour Party gained 150.

The Liberal Democrats — junior partners in Britain’s coalition government — were down 64 county council seats, while Cameron’s ruling Conservatives lost 182 seats.

UKIP leader Nigel Farage — whose party Cameron once referred to as a bunch of “fruitcakes, loonies and closet racists” — said the results will send a “shock wave” through the British political establishment.

“This is a real sea-change in British politics,” Farage told the BBC.

Cameron’s popularity has taken a beating as the government sticks to a strict policy of austerity to cut Britain’s debts, slashing public sector jobs and welfare payments.

As results streamed in highlighting UKIP’s strong showing in the election, Cameron said respect must be shown for those who chose to support the party.

“We are going to work really hard to win them back,” he added.

The prime minister now finds himself in the difficult position of trying to shore up right-wing backing ahead of the next general election in 2015, while trying to maintain his own affinity for more left-wing causes.

The results are a mixture of typical midterm protest and “rage against the machine,” said Tony Travers, director of the government department at the London School of Economics and Political Science.

“It is a traditional midterm protest vote and it’s found its lightning conductor through UKIP,” Travers said. “However, there is a more generalized protest that isn’t just against this government in its midterm, but is also a protest against mainstream elite politics.”

He suggested UKIP’s appeal — and the local election results — bear echoes of the Tea Party movement in the US, complete with cries of “we need to get our country back.”

“This is a vote against ‘they’re all the same.’”

While Friday’s results will jeopardize the Conservative Party’s success in the 2015 general election, Travers was skeptical the local elections would steer Cameron further to the right.

“Cameron is quite awkwardly trapped,” Travers said. “The number of options available to him to shift towards UKIP are limited if he’s to keep faith with his own commitment to modernizing the Conservative Party,” Travers said.

Still, the results in the short term could lend momentum to voices within Cameron’s party urging the prime minister to introduce legislation needed to enshrine his pledge for a referendum on European Union membership by 2017.

That promise of a referendum was seen by many as a political play to shore up support for the Conservatives amid growing signs of discontent within the party and voters flocking for the exits.

The heart of UKIP’s success lies not only in harnessing anti-immigration sentiment and appealing to socially conservative views on gay marriage, but exploiting Britons frustrations with a stagnating economy.

John Curtice, a politics professor at the University of Strathclyde, said the challenges facing Cameron’s Conservatives in clawing back voters were underscored by the response to the prime minister’s pledge to change Britain’s relationship with the EU.

“It went absolutely nowhere,” Curtice said. “What they have to do now above all is restore the public’s faith in the competence of the government — in particular its economics. That will help to bring these folks back.”

But while many called the local elections indicative of a protest vote, UKIP leader Farage dismissed any suggestion the UKIP surge would be a short-lived phenomenon.

“The next big vote is a European election this time next year in which we will be positioned as the only party saying we should divorce ourselves from a political union and have a simple free trade alternative,” he told the BBC

Voting took place in 34 council contests across England, plus the Isle of Anglesey in Wales.

Copyright 2013 The Associated Press.