David Cameron will face down Tory Eurosceptics on the right of the party who want to forge an alliance in the European parliament with opponents of Angela Merkel in Germany.
Amid fears among moderate Tories that the Eurosceptics will feel emboldened by the success of Ukip, the prime minister is making clear that he will block any attempt to invite the new Alternative for Germany (AfD) party into the Conservatives' pan-European grouping.
Cameron has told colleagues that he sets such store by his relationship with the German chancellor that he would never allow her opponents to join the Tories.
He spoke to Merkel and five other European leaders before an informal heads of government EU summit on Tuesday evening.
Moderate Tories were alarmed this year by reports that Daniel Hannan, the anti-EU Tory MEP, was in discussions with the AfD about a possible application to join the Alliance of Conservatives and Reformists (AECR), the broad grouping of which the Tories are members.
The AfD, whose leader, Bernd Lucke, said over the weekend that the Tories were a natural partner, won seven seats in Strasbourg after campaigning for countries hit in the European financial crisis such as Greece to leave the eurozone.
Senior Tory sources say Cameron will ensure the AfD does not sit in the Tories' European Conservatives and Reformists (ECR) bloc in the European parliament. They will also ensure that it does not join the wider group, in which Hannan plays a leading role – the AECR umbrella group, which includes members beyond the EU.
The Tories' sources were also clear that the party leadership would look very carefully about admitting the controversial anti-immigration Danish People's party (DPP), the winner of the European elections in Denmark, into its group.
They said a careful process of "due diligence" would be carried out on the party, which forced Denmark's centre-right government in 2011 to introduce tougher border controls. A party spokesman once likened the Muslim headscarf to the Nazi swastika.
Tory sources intervened after Morten Messerschmidt, a leading figure in the DPP, said the Tories were his party's natural allies.
Martin Callanan, the Tory chairman of the ECR, who lost his seat in this year's elections, confirmed this month that he had been courting the party.
A Tory source said: "Martin and Dan were acting in their personal capacity. They were not acting on behalf of the prime minister."
The sources said that Cameron regards Merkel's CDU as the Tories' sister party in Germany, even though he upset Merkel when the took the Conservatives out of the pan-EU European People's party. The CDU is the largest party in that group.
Hannan, who is expected to become a more influential figure in Strasbourg after Callanan lost his seat, said on Monday that Britain should leave the EU. He said the UK should forge the sort of trading relationship with the EU enjoyed by Switzerland.
The MEP also called for the Tories to form a pact with Ukip. Hannan told The World at One on BBC Radio 4: "I don't think there is going to be a grand deal but I think there is scope for some local accommodations. I think of situations like the Eastleigh byelection. There were two candidates there [Tory and Ukip] standing on virtually identical platforms – both centre-right, both Eurosceptic, both pro-referendum. Between them they got 53% of the vote and they both lost."
But Margot James, a member of the No 10 policy board, said: "The Conservative party stands for change in Europe – achieving much-needed reforms followed by a referendum, assuming the Conservatives get back into power with David Cameron as prime minister."
guardian.co.uk © Guardian News and Media Limited 2010