The British pound crashed to its lowest levels in 31 years as the country voted to leave the European Union in a historic referendum.

The pound dropped as low as $1.32 versus the U.S. dollar in overnight trading, a level not seen since 1985. It was down against all major world currencies. At the end of the London trading day on Friday, the pound was down by nearly 9% against the dollar, making this one of the biggest one-day declines on record.

The U.K. is the first country to vote to leave the European Union. Prime Minister David Cameron resigned Friday, saying he would hand over to a new leader in about three months.

Stocks markets around the world are also fell sharply after the campaign to leave the EU won Thursday's referendum.

"It is vile and ugly out there, the British pound is facing its worst day ever," said Naeem Aslam, chief market analyst at ThinkForex.

Economists had been warning for months that if the U.K. referendum resulted in a vote for a British exit (Brexit) from the EU, that would do lasting damage to the British economy.

As the market fell, the Bank of England said it will take all necessary steps to meet its responsibilities for monetary and financial stability.

"The Bank of England is monitoring developments closely. It has undertaken extensive contingency planning and is working closely with HM Treasury, other domestic authorities and overseas central banks," it said in a statement.

"Day after day, we looked up and worried that the sky might fall on our heads. And then one day.... it did," tweeted Kit Juckes, strategist at Societe Generale.

Related: Markets around the world start freaking out

The pound swung wildly during the referendum campaign in response to opinion polls.

It even reached $1.50 overnight as investors grew increasingly confident the U.K. would vote to stay in the bloc.

But that changed rapidly as preliminary results from the vote were declared.

"What we're seeing now is the market reacting with complete shock and bewilderment as the results unfold," said Trevor Charsley, analyst at AFEX.

"Investors were not prepared for this and this is what you get when you have premature celebrations."