LONDON – Outgoing Prime Minister David Cameron said Monday that his government would immediately begin preparatory work on the mammoth task of disengaging Britain from the European Union, a process that is likely to take years and that has already rattled markets around the world.

Cameron pledged that Britain’s decision to leave the E.U. would not mean a lapse into isolationism. He said that maintaining close links with Britain’s neighbors remained important.

“We must not turn our back on Europe or on the rest of the world,” said Cameron, who had campaigned to stay in the E.U. but lost last Thursday’s referendum on the question of continued membership. “The nature of the relationship we secure with the E.U. will be determined by the next government. But I think everyone is agreed that we will want the strongest possible economic links with our European neighbors as well as with our close friends in North America, the Commonwealth and important partners like India and China.”

Markets remained jittery, with the London stock exchange losing more than 2% of its value Monday, closing below 6,000 points, and the British pound plummeting to its lowest level against the dollar in 31 years. A number of companies in Britain have also begun talking about the possibility of relocating some of their operations or jobs to the Continent.

“It’s clear that markets are volatile. There are some companies considering their investments,” Cameron told the House of Commons. But “we should take confidence from the fact that Britain is ready to confront what the future holds for us from a position of strength.”

Cameron, who announced last Friday that he would step down from office by autumn, appeared to rule out any rerun of the referendum, which was won by the “Leave” side by a slight margin of 52% to 48%. An online petition demanding another vote has garnered more than 3 million signatures, though many of the signatures appear to be invalid.

“There can be no doubt about the result,” Cameron said. “The decision must be accepted, and the process of implementing the decision in the best possible way must now begin.”

A new government department will immediately be set up to start laying the groundwork for Britain’s exit from the E.U. But the leaders of the campaign to quit the 28-nation club have yet to present a unified vision of what Britain’s relationship with the rest of Europe will, or at least ought to, look like post-Brexit.

Cameron said that the formal request to the E.U. to withdraw, which triggers the official exit process, would be left to his successor to issue. A new prime minister is expected to be selected by the ruling Conservative Party in September.

And even after that formal request is made, negotiations over the terms of the exit are likely to last at least two years, if not longer. Between now and then, Britain remains a member of the E.U. and subject to its privileges and restrictions.