Scotland's top legal officer has said the Scottish Parliament's consent is needed before the UK triggers Brexit.

Lord Advocate James Wolffe said he was not arguing Holyrood had a veto, but said its consent was required because of the "significant changes" Brexit would make to its powers.

He was speaking on day three of the Supreme Court battle over who can invoke Article 50 of the Lisbon Treaty.

Ministers say they can do so with without consulting Parliament.

But campaigners dispute this, and earlier on Wednesday their lead lawyer said the government's argument "violates" basic principles of constitutional law.

Lord Wolffe, who will continue his argument on Thursday, agreed the UK Parliament should be consulted, and argued that Holyrood should also have a say.

The UK government has already responded to his argument, telling the court on Tuesday it was "fatally undermined" by powers over foreign affairs being reserved to Westminster.

Giving notice under Article 50 begins two years of formal Brexit talks.

Good Friday Agreement

The court also heard from lawyers from Northern Ireland, who said triggering Brexit could have a profound effect on the 1998 agreement at the heart of the peace process.

David Scoffield QC warned potentially "cavalier" ministers could materially alter "a carefully constructed devolution settlement". Another QC, Ronan Lavery, said since 1998 it had been for the people of Northern Ireland to decide their constitutional future, and that there could be no change without their consent.

"It would be very disturbing for the people of Northern Ireland that the terms so agreed in the Good Friday Agreement were not binding to some extent and did not have a constitutional status," he said.

Lord Pannick completes his argument

Earlier on Wednesday, Lord Pannick, representing Gina Miller, the lead campaigner calling for MPs to get a say, rounded off his argument.

He was grilled by Supreme Court president Lord Neuberger, who said it might seem "surprising" if the EU referendum had "no legal effect".

Lord Pannick said this had been the intention of Parliament when it passed legislation paving the way for June's referendum.

This law, he said, "simply says there should be a referendum - it says nothing more" and was designed to advise Parliament and the government.

It did not intend to hand ministers the power to invoke Article 50, he said.

Media playback is unsupported on your device Media caption Lord Neuberger asks Lord Pannick about the legal status of the EU referendum

He also argued that other Commons votes - such as the one taking place on Wednesday afternoon - would not count as Parliamentary authorisation.

"The law of the land is not altered by a motion in Parliament," he said.

"This is a basic constitutional principle."

What's at stake

Media playback is unsupported on your device Media caption What will the Supreme Court be considering in the Article 50 case?

The case is about whether the law means that the government needs the authority of Parliament to trigger the process for the UK to leave the EU

The government argues it can start the Article 50 process using "prerogative powers", a remnant of the era of all-powerful kings and queens

Justices will be ruling on who has the legal power to change the rights of British citizens

Read legal correspondent Clive Coleman's full analysis

How we got here

Image copyright Getty Images Image caption Gina Miller's legal team are putting her case to the Supreme Court

The government says it will trigger Article 50 by the end of March, which begins two years of formal Brexit talks.

It has said it will keep its cards close to its chest ahead of the negotiations, and has so far revealed little about what it will demand.

Campaigners, led by Ms Miller and hairdresser Deir Dos Santos, say triggering Article 50 requires Parliamentary approval, and won at the High Court last month.

The government has appealed to the Supreme Court, whose 11 justices are all hearing the case with a decision expected in January.