It seems that every time UK Prime Minister David Cameron goes abroad, he has to apologize to his hosts for policies he has implemented to appease his Conservative Party’s increasingly unruly right wing.

During a recent trip to India, he had to grovel to the government in Delhi because of the new immigration caps on non-EU students seeking to enter the UK. Last year, Cameron’s Conservative–Liberal Democrat coalition had decided to reduce the number of student visas issued in order to bring down annual net immigration. Putting a limit on the number of foreign students allowed in is relatively simple administratively and ensures that Britain does not fall foul of its human rights obligations.

British universities issued stark warnings that this policy would deal a serious blow to the economic viability of tertiary education in the UK. And it looks as if both the Indian government and university vice-chancellors were right: in the wake of the cap, the number of first-year students from India enrolled at British universities has fallen by 32 percent.

Of course, it’s Britain’s loss. Those bright young people will go to the United States instead, or to one of the growing number of high-quality Anglophone schools in countries as diverse as the Netherlands, Turkey, or Brazil. The result will be a significant loss of market share in one the few industries where Britain has a real structural advantage. Furthermore, fewer British-trained students will mean an erosion of the country’s long-term influence in the world.

What does Cameron get in return? Perhaps a couple of marginal seats at the next parliamentary elections.

But immigration issues are nothing compared with the nightmare that the prime minister faces over the European Union. The combined forces of the UK Independence Party (UKIP) and Cameron’s own backbench rebels must appear to him as a pack of fighting dogs, yapping and growling their constant demand for an immediate in-or-out referendum on EU membership.

In years gone by, Tory leaders would have simply told the malcontents to shut up. Even so meek a leader as former prime minister John Major did precisely that on the very same issue of EU membership.

But Cameron faces a situation that no postwar Conservative leader has ever had to deal with—a real electoral threat from the right, namely UKIP. In last month’s local elections, UKIP scored 23 percent of the popular vote, just two percentage points less than the Conservatives. Such a surge is unlikely to be repeated at a general election, but UKIP is still a huge threat to the Conservatives.

Both parties in Cameron’s coalition are being hit by defections. While the great majority of UKIP voters used to be loyal to the Tories, many Liberal Democrats are now turning back to the Labour Party. The same local elections that gave UKIP such a fillip revealed a fall in the Liberal Democrat vote to a calamitous 14 percent. There are just too many Liberal Democrat members unhappy with the party’s support for Cameron’s rigid economic austerity policies.

For Cameron, UKIP’s rise and the Liberal Democrats’ collapse conjure up the terrifying possibility that the Conservative vote could be split down the middle at the next election, handing the Labour Party a large majority. For now, Labour under Ed Miliband enjoys only anemic support. But it could still win an outright majority because of Britain’s increasingly untenable first-past-the-post electoral system.

Faced with this threat, Cameron’s strategy is to repeat promises for an in-out referendum on EU membership. But his aim is to hold it at a time (probably between 2018 and 2020) when the economies of both Britain and the eurozone will have improved sufficiently for voters to be less susceptible to UKIP’s and the Tory right wing’s anti-European charge.

Nigel Farage, the leader of UKIP, is fully aware of this scenario. He understands that Britain’s economic performance is unlikely to remain this grim forever. Therefore, his upstart party has only one shot at getting a substantial number of members of parliament. Once the party is established, UKIP might be able to consolidate itself as a genuine force in British politics. But if UKIP fails to get a foothold in the 2015 elections, that will probably be the end of any long-term political prospects.

As if UKIP wasn’t enough of a threat on its own, it seems to have found an ally in the Conservative Party’s right-wing, anti-European caucus. Clearly, Cameron believes he has no choice but to kowtow to this aggressive alliance.

As long as he does this, he will hear the same message every time he visits Washington or receives guests from Berlin. To paraphrase: “What in God’s name do you think you are doing? If you even consider quitting the EU, we will make damn sure that, economically and politically, Britain will be relegated to the global backwater!”

Cameron is caught between a rock and a hard place. There aren’t many—either inside or outside the Conservative Party—who think he has a way out.