Theresa May has been forced to publish the final and full legal advice on her Brexit deal after suffering a humiliating Commons defeat.

The Prime Minister caved in moments after MPs decided her ministers were in contempt of Parliament.

A motion tabled by Labour, the SNP, other opposition parties and the DUP which argued ministers were in contempt due to their failure to fully publish advice given to Cabinet by attorney general Geoffrey Cox was approved by 311 votes to 293, majority 18.

It also ordered the immediate publication of the legal advice.

Commons leader Andrea Leadsom said: "We've tested the opinion of the House twice on this very serious subject.

"We've listened carefully and in light of the expressed will of the House we will publish the final and full advice provided by the attorney general to Cabinet but recognising the very serious constitutional issues this raises I have referred the matter to the privileges committee to consider the implications of the humble address."

MPs had earlier rejected a Government amendment to the motion, which Labour argued sought to kick the issue into the "long grass" until after the vote on the Brexit deal, by 311 votes to 307, majority four.

This amendment asked for the Committee of Privileges to question whether ministers were in contempt of Parliament over the issue and could have delayed any publication of the advice.

Shadow Brexit secretary Sir Keir Starmer said the finding of contempt was a "badge of shame" for the Government.

He said: "Today's finding of contempt is a badge of shame for this Government. It is of huge constitutional and political significance.

"Never before has the House of Commons found ministers in contempt of Parliament. It is highly regrettable that the Government has let it come to this, but ministers left the opposition with no option but to bring forward these proceedings.

"By treating Parliament with contempt, the Government has proved it has lost its majority and the respect of the House. The Prime Minister can't keep pushing Parliament away or avoiding responsible scrutiny."

Theresa May's Government suffered a third Commons defeat of the day after MPs approved an amendment from Tory Dominic Grieve which aims to give them a greater say should the Brexit deal be defeated on December 11.

SNP justice spokeswoman Joanna Cherry said her party had backed the amendment "to ensure democracy is not steamrollered and this Parliament has a meaningful say".

She added Scottish parliamentarians had provided a third option to Theresa May's deal or no deal with the European Attorney General saying Article 50 can be unilaterally revoked for no Brexit.

Ms Cherry added: "It will be remembered that it was Scotland that threw this Parliament and the whole of the UK a lifeline."