Media playback is unsupported on your device Media caption Michael Gove: EU court stands above nation states

The package of reforms negotiated by David Cameron cannot be reversed by European judges, according to the EU Council president.

Donald Tusk told MEPs the deal was "legally binding and irreversible".

It comes after Justice Secretary Michael Gove told the BBC the European Court of Justice could throw out some measures without EU treaty change.

Both Downing Street and attorney general Jeremy Wright say the reforms cannot be reversed.

A UK referendum on whether to remain a member of the EU will take place on 23 June, with the Conservative Party and David Cameron's cabinet divided over which side to support.

Mr Gove, one of five cabinet ministers campaigning for an EU exit, said that without treaty change all elements of the PM's renegotiation settlement were potentially subject to legal challenge.

"The facts are that the European Court of Justice is not bound by this agreement until treaties are changed and we don't know when that will be," he said.

He said Mr Cameron was "absolutely right that this is a deal between 28 nations all of whom believe it", adding: "But the whole point about the European Court of Justice is that it stands above the nation states."

But the PM's spokesman said the text of the deal would be deposited at the United Nations later on Wednesday, adding that this would "put beyond doubt that it is legally binding and irreversible in EU law".

Mr Tusk, who played a key role in negotiating the settlement, said it was "in conformity with the treaties and cannot be annulled by the European Court of Justice".

He said: "But it will only enter into force if the British people vote to stay. If they vote to leave, the settlement will cease to exist."

The UK's negotiation "was the first round… and the last", he added.

Analysis

Analysis by Clive Coleman, BBC legal affairs correspondent

If it walks, talks and smells like a treaty, then it is a treaty.

What is important is the substance of the agreement and not the label "treaty".

As Mr Gove acknowledges, this is a "deal between 28 nations all of whom believe it". In other words, all of whom intend to be bound by it.

The more significant question is, perhaps, what is the value and status of the deal as a matter of EU law?

Read the rest of Clive's analysis

Mr Tusk was speaking at the first European Parliament session since the European Council summit where the reforms were agreed following drawn-out negotiations between leaders.

BBC political correspondent Ben Wright in Brussels said there was some "exasperation" on show from some political groupings that they "had been forced to go through this in the first place".

Earlier Downing Street responded to Mr Gove's comments on legality by citing Alan Dashwood, the former director of legal services at the EU, who said the "Decision" was a binding legal agreement reached by consensus and could only be amended or rescinded by consensus - or, "in other words, with the agreement of the UK".

The European Court of Justice was set up in the 1950s to ensure European law is interpreted and applied evenly in every EU country but many Tory MPs believe it has over-extended its jurisdiction and its powers should be rolled back.

Martin Schulz, the president of the European Parliament, said the guarantee that the UK would be exempted from ever-closer union would be "written exactly" into the treaties in the form it was agreed last week and "nobody can tell British voters other things".

Analysis by BBC political editor Laura Kuenssberg

Image copyright Getty Images

Mr Gove's comments will be catnip for Eurosceptics who've already been arguing that Mr Cameron's deal is hardly worth the paper its written on.

For David Cameron, maintaining the sense that the deal he's achieved can and will improve the UK's relationship with the rest of the European Union in a meaningful way is a vital part of his campaign.

It's one thing Tories from different parts, different generations of the party, disagreeing. It's quite another when it is two who have shared political hopes, ambition, and even family holidays.

Read more from Laura

Joshua Rozenberg: Does the EU impact on UK sovereignty?

Mr Wright, the government's senior law officer, told the BBC that although challenges could be brought to the European Court of Justice, the UK agreement had "very similar legal strength" to existing treaty obligations.

"The suggestion that this agreement does not have legal effect until it is incorporated into EU treaties is not correct. That is not just my opinion - it is the opinion of this government's lawyers, lawyers for the EU, and, I suspect, the majority of lawyers in this country."

Former attorney general Dominic Grieve told the BBC that Mr Gove was simply "wrong".

Media playback is unsupported on your device Media caption In full: Michael Gove talks to Laura Kuenssberg about why he backs an EU exit

But the justice secretary's comments were seized upon by Conservative MPs campaigning for the UK to leave the EU.

Human rights minister Dominic Raab said: "The last word on enforceability very clearly lies with the European Court of Justice in Luxembourg."

Speaking during the European Parliament session, UKIP leader Nigel Farage said lodging the document with the UN was "completely meaningless".

"You might as well lodge a pair of socks," he added.

Ministers who want to quit the EU have been allowed special dispensation to oppose the government at the referendum, although strict rules have been put in place for the campaign.

The BBC has been told that following Mr Gove's interview, Downing Street ordered his officials to stop showing him documents concerning the EU.

Number 10 said Mr Gove was subject to the same rules as every minister arguing for the UK to leave the EU and the move was nothing to do with his comments.

In other referendum developments, the head of the International Monetary Fund, Christine Lagarde, said she thought the impact of the UK leaving the EU was "bound to be a negative on all fronts".

She added that it would be a bad development "For those who stay, because there are fewer of them, and for those who go, because they lose the benefit of that facilitation of exchange."