David Cameron's plan for new legislation to assert the sovereignty of the UK Parliament is "pointless" because European courts would be able to override it, a former Attorney General has said.

The Prime Minister is expected to publish plans within the coming weeks for the UK Supreme Court to act as a "constitutional longstop" to regulate the impact of EU law on the UK in a way already done in Germany.

Justice Secretary Michael Gove, who is developing proposals, insisted on Monday that it was "not a nonsense at all" to suggest that legislation could overrule the primacy granted to EU law under treaties.

"Look at the examples other European countries have," he told Channel 4 News. "In Germany, they have a constitutional court that has the power to say that sometimes EU law could be inconsistent with Germany's own basic law."

But former attorney general Dominic Grieve told BBC Radio 4's World at One: "By virtue of the treaties and the acts which followed our treaty of accession, primacy of European law and its interpretation is given to the Court of Justice in Luxembourg. In those circumstances it is difficult to see how any piece of legislation can alter that without our being in breach of the treaties.

"I would be interested to see how something beneficial can be achieved without in fact interfering with the treaty obligations, which it's quite clear that the Government doesn't intend to do.

"If we were in breach of the treaties it would simply go to the European Court of Justice in Luxembourg, who would - because their decisions have direct effect here - override whatever legislation we had passed, because that is the way in which the EU operates. It would in those circumstances be pointless."

Mr Grieve added: "That's not to say it isn't possible to have a dialogue between our own Supreme Court and the court in Luxembourg in which jurists who are considering the same piece of legislation may exchange views about what the legislation actually means. That's very desirable in any working justice system.

"But at the end of the day the buck stops somewhere. The treaty of accession and our own legislation make quite clear that at the end of the day it is the court of Luxembourg which has the last word, as indeed it has for every other state which is adherent to the EU."

Mr Cameron's official spokeswoman said: "The Prime Minister is looking at ways to address the British people's concerns about sovereignty and our membership of the EU, both through the renegotiation and work that is ongoing to look at what more can be done.

"I don't think we should pre-empt that work. People should wait for us to set out what we propose to do in that area."

In a speech at Chatham House in November, Mr Cameron said he wanted to see whether the UK could adopt rights similar to those of Germany's Constitutional Court in reviewing whether essential constitutional freedoms are respected when powers are transferred to Europe and whether European directives and European court rulings overstep the EU's powers when applied domestically.

He told the House of Commons last week that he wanted to take steps to put "beyond doubt" the sovereignty of the UK Parliament, and was keen to do this at the same time as concluding EU reform negotiations - something which could come as early as the Brussels summit of February 18-19.

Robert Oxley, a spokesman for the Vote Leave campaign, said: "The Government's supposed rabbit of a new sovereignty law is vanishing before the PM can even pull it out of his hat. The only way to stop EU judges from controlling our laws is to vote leave."