Theresa May's Government has been defeated over key Brexit legislation despite a last-ditch attempt to quash a Tory rebellion.

MPs approved an amendment to the European Union (Withdrawal) Bill which guarantees Parliament a "meaningful" vote on any Brexit deal by 309 votes to 305, a majority of just four.

There were cheers in the chamber when the result of the vote became clear.

In a damaging blow to Theresa May, Tory rebels rallied around Dominic Grieve to back his attempt to ensure MPs can vote on the withdrawal deal.

A last-minute concession by justice minister Dominic Raab was dismissed as "too late" by Mr Grieve, whose amendment to the Bill squeezed through the Commons amid tense scenes in the chamber.

Tory MP Antoinette Sandbach labelled the Bill's powers as "sweeping", adding: "I'm afraid I'm not willing to give away parliamentary sovereignty that I exercise on behalf of my constituents for some residual control to the executive."

While some would-be rebels such as George Freeman and Vicky Ford said Mr Raab's promise of fresh limits on powers in the Bill was enough for them to back down, it was not enough for the Government to avoid defeat.

Following the vote, Tory rebel Nicky Morgan tweeted: "Tonight Parliament took control of the EU Withdrawal process."

A Labour amendment, seeking to remove the capacity of ministers to modify and amend the Act via delegated powers, was defeated by 316 votes to 297.

SNP international affairs spokesperson Stephen Gethins MP has said the result of Wednesday's vote was "symptomatic of the utter confusion and chaos at the centre of their Brexit mess".

He added: ''The Tories need to learn a lesson and listen following this defeat. This is the first parliamentary defeat for Theresa May and the amendment - which the SNP supported - is essential to the scrutiny that is so clearly lacking from so much of the Brexit shambles.

''The UK government tried to defend the indefensible and tonight's humiliation for the Tories was completely avoidable.

"Theresa May and her Brexit ministers need to reach out - and not just listen to their paid up supporters in the DUP. They need to listen to the views of all parties in this parliament of minorities.

''For the past eighteen months, the UK government has at every opportunity avoided scrutiny and due parliamentary process. The Tories cannot simply railroad ahead with its plans to leave the EU."

As May prepared to travel to a Brussels summit on Thursday where European Union leaders are expected to rubber-stamp Brexit negotiations moving on to trade, Labour leader Jeremy Corbyn said: "This defeat is a humiliating loss of authority for the Government on the eve of the European Council meeting.

"Theresa May has resisted democratic accountability. Her refusal to listen means she will now have to accept Parliament taking back control."

A Government spokeswoman said: "We are disappointed that Parliament has voted for this amendment despite the strong assurances that we have set out.

"We will now determine whether further changes are needed to the Bill to ensure it fulfils its vital purpose."