Though he would have preferred that the UK stayed in the European Union, US President Barack Obama said he respects the decision of the British people and reassured them that their special relationship with the US will remain.

“The people of the United Kingdom have spoken, and we respect their decision.” the president said in the statement Friday morning, after the UK referendum was carried by the vote to leave the European Union.

READ MORE: US politicians respond to Brexit with domestic interests in mind

“The special relationship between the United Kingdom and the United States is enduring, and the United Kingdom’s membership in NATO remains a vital cornerstone of US foreign, security and economic policy,” Obama added.

Obama statement on Brexit vote pic.twitter.com/GxH8us6aON — Mark Murray (@mmurraypolitics) June 24, 2016

Obama also assured those in the European Union, which the president said has done “so much” to promote stability and economic growth, that the bloc’s relationship with the US will remain unchanged.

"The United Kingdom and the European Union will remain indispensable partners of the United States," Obama said.

During a visit to the UK in April, Obama had urged voters to cast their ballots for “Remain,” warning that if the country left the EU it would be at the “back of queue” for trade deals with the United States such as the Transatlantic Trade and Investment Partnership (TTIP).