British lawmakers have voted in favor of taking control of Brexit, undermining the government of Prime Minister Theresa May.

MPs voted 329 to 302 late on Monday to give the House of Commons more authority in handling the country’s possible exit from the EU.

They also rejected a personal plea by the British premier to stop the measure.

Introduced by Conservative MP Oliver Letwin, the amendment would enable the MPs to bring forward their own Brexit motion and indicative votes for alternative Brexit paths Wednesday.

The move could bring about a soft Brexit customs union compromise, or even a second referendum on the UK’s decision to leave the European Union.

According to a spokesperson for the Department for Exiting the European Union, it "upends the balance between our democratic institutions and sets a dangerous, unpredictable precedent for the future.”

“While it is now up to parliament to set out next steps in respect of this amendment, the government will continue to call for realism," the spokesperson said, calling for MPs to choose options that were "deliverable in negotiations with the EU."