Boris Johnson has gambled his long-standing ambition to become Britain’s next Prime Minister on winning the referendum to pull the country out of the European Union as he became the most significant Tory to come out in favour of Brexit.

In a statement Mr Johnson said that after a “huge amount of heartache” he had made the “agonisingly difficult” decision to go against David Cameron and “advocate Vote Leave”.

But significantly he suggested that a no vote might not necessarily result in the UK pulling out of the EU altogether instead, creating a “new relationship based upon trade and cooperation”.

Speaking outside his home, Mr Johnson said the EU was "a political project that has been going on for decades, and is now in real danger of getting out of proper democratic control".

Mr Johnson said he couldn't "pass up the only chance any of us have in our lifetimes to put an alternative point of view".

He asked: "Is it better for Britain to remain in Europe as it currently is, or is there a way that we could actually get a better deal that did more for Britain, and restored some control to the people in this country?"

Congratulating David Cameron on doing "fantastically well" in the time he had to negotiate a new deal with Brussels, Mr Johnson addressed comments the Prime Minister made earlier by saying he would not be standing on a podium with “the likes of” George Galloway or Nigel Farage or speaking against members of his own party in TV debates.

His decision nonetheless makes him the natural leader of the leave campaign, and the natural front-runner to become Prime Minister should the country vote "out" in June’s referendum.

While David Cameron has insisted he would stay on whatever the result most senior Conservatives believe he would have no choice but to resign immediately if there is a ‘leave’ vote.

That would place Mr Johnson in poll position to succeed him in a vote of Tory MPs and activists.

However, should the country back the Prime Minister and vote to stay Mr Johnson will be associated with the failed campaign – damaging his reputation as an electoral asset to the Tories.

He can also expect few favours from Mr Cameron who is said to be “furious” both at Mr Johnson’s decision and the manner in which he has strung it out.

“I can’t understand why Boris, as leader of the great financial capital, won’t support the city,” he is said to have aides.

How his position has shifted “The trouble is, I am not an ‘outer’.” January 2016 “You have got a supreme judicial body in the European Court of Justice that projects down on this 500 million-people territory a single unified judicial order from which there is no recourse. In my view, that has been getting out of control. There is too much judicial activism, there is too much legislation coming from the EU.” Today “There would be several disadvantages [to leaving]. First, we wouldn’t be able to stick up for what we believe in. Secondly, we would face some penalties.” August 2015 “I now think [the EU] is in real danger of getting out of proper democratic control.” Today “Leaving would cause at least some business uncertainty, while embroiling the Government for several years in a fiddly process of negotiating new arrangements, so diverting energy from the real problems of this country – low skills, low social mobility, low investment etc – that have nothing to do with Europe.” February 2016

One minister said: "I think Boris has done himself quite a lot of damage. He's been all over the place. Saying to people in the Commons, 'I'm not an outer,' but flirting with Brexit. People are left thinking that it's not a point of principle."

Sir Nicholas Soames, the former defence minister who is a Cameron loyalist, highlighted the Tory leadership’s suspicions about Johnson when he tweeted: “Whatever my great friend Boris decides to do I know that he is NOT an outer.”

The London Mayor denied his decision had anything to do with his ambition and said he had agonised about going against the Prime Minister, whom he informed of his decision in an email on Saturday.

“The last thing I wanted was to go against David Cameron or the Government but after a great deal of heartache I don’t think there is anything else I can do,” he said.

“I will be advocating Vote Leave ... because I want a better deal for the people of this country to save them money and to take back control.”

He claimed he had told Mr Cameron that he wanted him to stay as Prime Minister even if there was a vote to leave. However, many believe that Mr Johnson would ideally like to take over as Prime Minister and then attempt to renegotiate a new deal with the EU on the basis of the Out vote. Other European leaders have already dismissed this idea.

Many believe Mr Johnson has calculated that he would have had little chance of winning the Tory leadership over George Osborne or Theresa May if he had decided to join the In campaign.

Instead he is gambling that his popularity will help sway voters to ‘leave’ cause and reassure them that Britain can thrive outside the European Union.

A source in the “remain” campaign was scathing about Mr Johnson’s announcement. “This is the most nakedly self-serving piece of political positioning in years,” they said. “Everybody in Westminster knows that Boris doesn’t really believe in Out. He’s putting his personal ambition before the national interest.

Mr Johnson’s declaration also drew a scathing response from the former Conservative Deputy Prime Minister Lord Heseltine, who branded it “illogical”. “If it takes you this long to make up your mind about something so fundamental and you still have questions, then surely the right option is to stay with what you know rather than risk our economy and security with a leap in the dark,” he said.

What has the EU ever done for us? Show all 7 1 /7 What has the EU ever done for us? What has the EU ever done for us? 1. It gives you freedom to live, work and retire anywhere in Europe As a member of the EU, UK citizens benefit from freedom of movement across the continent. Considered one of the so-called four pillars of the European Union, this freedom allows all EU citizens to live, work and travel in other member states. What has the EU ever done for us? 2. It sustains millions of jobs A report by the Centre for Economics and Business Research, released in October 2015, suggested 3.1 million British jobs were linked to the UK’s exports to the EU. What has the EU ever done for us? 3. Your holiday is much easier - and safer Freedom to travel is one of the most exercised benefits of EU membership, with Britons having made 31 million visits to the EU in 2014 alone. But a lot of the benefits of being an EU citizen are either taken for granted or go unnoticed. What has the EU ever done for us? 4. It means you're less likely to get ripped off Consumer protection is a key benefit of the EU’s single market, and ensures members of the British public receive equal consumer rights when shopping anywhere in Europe. What has the EU ever done for us? 5. It offers greater protection from terrorists, paedophiles, people traffickers and cyber-crime Another example of a lesser-known advantage of EU membership is the benefit of cross-country coordination and cooperation in the fight against crime. What has the EU ever done for us? 6. Our businesses depend on it According to 71% of all members of the Confederation of British Influence (CBI), and 67 per cent of small and medium-sized enterprises (SMEs), the EU has had an overall positive impact on their business. What has the EU ever done for us? 7. We have greater influence Robin Niblett, Director of think-tank Chatham House, stated in a report published last year: “For a mid-sized country like the UK, which will never again be economically dominant either globally or regionally, and whose diplomatic and military resources are declining in relative terms, being a major player in a strong regional institution can offer a critical lever for international influence.

His would-be successor as Mayor of London, the Tory candidate Zac Goldsmith, has also confirmed he will vote to leave the EU.

Mr Johnson laid out his reasons for backing Brexit in an article for The Daily Telegraph, for which he works as £274,000-a-year columnist on top of his job as Mayor of London. In it, he said federalism had been born “of the highest motives” and added: “They [federalists] just have a different view of the way Europe should be constructed."

Friends said he had been genuinely conflicted about the right thing to do and denied that leadership calculations played a part in his decision.

"He genuinely thinks Britain should not turn its back on Europe at a time like this. He feels that very deeply, but he genuinely thinks the deal is pretty hopeless, that Cameron should have asked for more and that what they have come up with on sovereignty doesn't do what he wants it to do."

Mr Johnson is said to have told one person he met recently: "I'm veering all over the place like a shopping trolley."

EU referendum timeline - What happens if Britain gets the deal

Earlier in the day Mr Cameron issued a last-ditch appeal to Boris Johnson not to join the campaign for Britain to leave the European Union.

"I would say to Boris what I say to everybody else, which is that we will be safer, we will be stronger, we will be better off inside the EU," the Prime Minister told BBC1's The Andrew Marr Show.

"I think the prospect of linking arms with Nigel Farage and George Galloway and taking a leap into the dark is the wrong step for our country.

"If Boris and if others really care about being able to get things done in our world, then the EU is one of the ways in which we get them done."

Labour’s shadow foreign secretary Hilary Benn said that declaring for the out side could backfire on Mr Johnson.