Branded merchandise is seen in the office of pro-Brexit group pressure group "Leave.eu" in London, Britain February 12, 2016. REUTERS/Neil Hall

UNITED NATIONS (Reuters) - Britain on Wednesday registered with the United Nations a deal on new terms for its membership in the European Union ahead of a June 23 national referendum on whether Britain should stay or quit the 28-nation bloc.

Britain’s U.N. Ambassador Matthew Rycroft said he registered the text of the deal as an official treaty at the United Nations. He said it has officially entered into force, but will only take effect if Britain votes in June to remain in the European Union.

Rycroft told reporters that registering the deal at the United Nations “puts beyond doubt the fact that the deal the prime minister agreed is legally binding and irreversible in international law.”

British Prime Minister David Cameron and EU leaders agreed unanimously last week on a package of measures aimed at keeping Britain in the EU to avoid a potentially disastrous divorce.

Cameron, campaigning for Britain to stay in the European Union, has the edge over London Mayor Boris Johnson, the most popular figure in the “Out” camp, in trying to sway the key group of undecided voters, a new poll indicated on Wednesday.