Updated

It's often said that David Cameron is a lucky politician who has seemed to coast through politics on instinct and charm during a career that has culminated in six years as British prime minister. On Thursday, his luck ran out.

In calling a referendum on Britain's membership in the European Union, Cameron made a gamble that sank his career — and set his country on a course to leave an international alliance it joined more than 40 years ago. Speaking to assembled reporters outside his Downing Street office Friday, he said he would stay on for as long as was necessary for stability's sake, but that he could not be the one to lead Britain out of Europe.

"I will do everything I can as prime minister to steady the ship over the coming weeks and months," he said, "but I do not think it would be right for me to try to be the captain that steers the country to its next destination."

Brexit was a rare but fateful miscalculation for a politician who has a reputation for thriving under pressure and astutely judging political risks.

"I think he's actually been pretty stunned by the strength of the 'leave' cause," Cameron biographer James Hanning told The Associated Press several days ahead of the referendum. "The golden rule is, never hold a referendum unless you're confident of winning it, and I think he thought that the moderate voices would prevail by some distance."

The referendum campaign was unexpectedly bitter and divisive, and was brought to a shocked halt when Labour lawmaker Jo Cox was shot and stabbed to death in the street last week. The news appeared to dampen the momentum of the "leave" movement, but in the end the Brexit vote prevailed.

"The British people have made a decision to take a separate path," Cameron said Friday morning.

That decision was bitter news for Cameron, who called the referendum to puncture growing support for the anti-EU UK Independence Party and placate the strongly euroskeptic right wing of the Conservatives.

Victoria Honeyman, a lecturer in British politics at the University of Leeds, said Cameron had seen EU battles poison the leaderships of former Tory leaders John Major and William Hague and "feared a civil war in the Conservative Party."

She said the referendum was about "defusing that time bomb" — but Cameron has "moved from having one ticking time bomb to having another ticking time bomb."

When he promised the referendum, in 2013, Cameron said it would "settle this European question in British politics" once and for all.

He told voters he would forge a new deal between Britain and the EU that would make remaining an attractive prospect. At a Brussels summit in February, he won changes to welfare benefits that he said would reduce immigration and an exemption for Britain from the EU's commitment to "ever-closer union" — a phrase that stirs images of a European super-state in some patriotic British hearts.

But many voters proved resistant to Cameron's message that Britain is stronger, safer and more economically secure within the EU than it would be outside it.

The concessions he gained were dismissed as paltry by "leave" campaigners, who said they would do little to limit immigration from other EU nations because the bloc guarantees free movement among member states. It's a subject that resonated with many voters, who have seen hundreds of thousands of people come to Britain over the past decade from new EU members in eastern Europe. (Hundreds of thousands of Britons also live in other EU countries, a less remarked-upon fact).

"I think he has underestimated the enduring nature and the strength of the euroskeptic support in the country and also the extent of the bitterness inside his own party," Hanning said.