Sir John Major and David Cameron
Major has offered Cameron a ray of hopeReuters

Former prime minister John Major has attempted to introduce a ray of sunshine into the gloom hanging over David Cameron in his apparently doomed attempt to stop Jean-Claude Juncker becoming the next boss in Brussels.

Only hours after the prime minister appeared to concede defeat in his very public battle, Major said Juncker was the wrong candidate but it could all turn out in Cameron's favour as other EU leaders would then want to placate him with other concessions.

"The way Europe often works is if it has done something that is very much not to the interests of a particular country they often seek, both subliminally and publicly, to make that right in some other way," he said.

His optimistic remarks came after Cameron was quizzed over the appointment of the Euro-federalist Juncker to the job of EU Commission president and declared: "I will go on opposing this process right up to the end. There is absolutely no question of changing my view about that."

The comment was seen as a recognition of the fact other EU leaders, most notably Germany's Angela Merkel, had finally decided to end the wrangling and go ahead with Juncker, who had always been the favoured candidate.

Merkel had previously appeared open to compromise but after Cameron delivered a series of public attacks on the "stitch up" her attitude hardened and she is now said to be in favour of a final decision in the EU summit at the end of the month.

Cameron's hard-line and, more importantly, highly vocal campaign has already seen questions raised over his tactics with suggestions he had revealed his hand too early then continued to alienate other leaders with a series of attacks on their part in the appointments process.

Jean-Claude Juncker
Juncker has been at the centre of Brussels row

Some senior Tories are privately puzzled over why the prime minister made such a big deal over the issue when, they believe, there are far bigger battles ahead when Cameron enters negotiations with the EU ahead of his promised in-out referendum in 2017, should he win the next election.

His supporters insist it was right for him to put down a marker early on that he would not put up with "business as usual" in Brussels after Eurosceptics scored major advances across the continent in the recent elections to the parliament.

They argue Juncker's appointment would send out the worst possible message to voters that their concerns were not being heard and that, if Cameron was to make any headway in future negotiations, he needed to stake out his ground now.

It was also stressed that Cameron was particularly angry at the way the appointment was done, with the big political groups in the European parliament agreeing their candidates and then accepting the job would go to whichever group won most seats in the assembly.

The prime minister's critics, however, claim he should have proceeded with more caution and certainly less noise in order to allow a quiet compromise to be agreed but also to give himself a get out in the event of failure.

Major's remarks seem to be an attempt to offer that get out and give Cameron something to say to his troublesome Eurosceptic backbenchers if he fails.

But that seems an optimistic reading of events amid critics' fears that the issue only serves to show how isolated and ignored the UK has become in the EU as a direct result of Cameron's obstructive and negative policies.

Of course, if Cameron manages to pull it off at the last moment he will be hailed as a hero by his Eurosceptics. Although there must be the risk the resentment his campaign has caused may dog him throughout those more important negotiations ahead of 2017.