LONDON (Reuters) - Prime Minister Theresa May must win a vote in parliament to get her Brexit deal approved, or risk seeing Britain’s exit from the European Union descend into chaos.

Pro-Brexit and anti-Brexit protesters demonstrate outside the Houses of Parliament, ahead of a vote on Prime Minister Theresa May's Brexit deal, in London, Britain, January 15, 2019. REUTERS/Henry Nicholls

To win, May and her ministers have to overcome opposition from across the political spectrum.

Here’s how the voting will work:

WHO?

The debate takes place in the lower house of parliament, the House of Commons. May does not have an outright majority of the 650 lawmakers, and the DUP, the small Northern Irish party that usually props up her government, is opposed to the deal.

May needs 318 votes to get a deal through parliament as seven members of the Irish nationalist Sinn Fein party do not sit, four speakers do not vote and four lawmakers who help count votes, known as tellers, are not counted.

WHEN?

Parliament held three days of debate in December before May postponed a vote, acknowledging she was about to lose it. The debate restarted on Jan. 9 and will end at 1900 GMT on Jan. 15.

Once the debate has ended, a handful of amendments could come up for votes before the vote on the motion itself. Each vote takes around 15 minutes. If votes are held on each of four provisionally selected amendments, the whole process should finish around 2015 GMT.

Click on [BRXT] for live Reuters coverage of Brexit.

WHAT?

The debate will be on whether to approve a motion stating that parliament has approved the Withdrawal Agreement - a legal text setting out the terms of departure - and a separate political declaration outlining the long-term relationship Britain will have with the EU.

WHAT ARE AMENDMENTS?

John Bercow, the speaker of the house, has provisionally selected four amendments which could be put to a vote, though others could be selected during the day.

If approved, an amendment would be included in the final motion’s wording. In some cases, defeat on an amendment is so significant that the voting process is halted and the deal is considered to have been rejected.

While any successful amendments would not bind the government to comply with them, they would be politically hard to ignore, and could dictate May’s next steps.

Ministers have expressed concerns that if any amendment is passed by parliament, it could prevent the deal being ratified because the final vote may not then provide the legally necessary clear and unequivocal approval of May’s deal.

The amendments will be voted on before the deciding ballot on the overall motion. This means May has to win a series of votes, rather than just one, each with the potential to scupper her plan.

The amendments selected to be voted on are:

Amendment A

This has been proposed by the leader of the opposition Labour Party, Jeremy Corbyn, and would have three effects:

1) Reject May’s deal

2) Attempt to block Britain leaving without a deal

3) Demand the pursuit of every alternative exit strategy

Amendment K

This has been proposed by Scottish and Welsh lawmakers who say the deal damages their nations. It does two main things:

1) Rejects the existing deal

2) Demands an extension to the Article 50 negotiating period

Amendment B

This has been proposed by members of May’s Conservative Party. It sets out that Britain will tear up the withdrawal agreement if the EU refuses to agree to a way of ending the special ‘backstop’ arrangements in place to prevent a hard border between Northern Ireland and Ireland.

Amendment F

This has been proposed by a member of May’s Conservative Party. It sets out to make approval conditional on Britain negotiating the right to terminate the backstop without needing EU consent.

HOW WILL THE RESULT BE ANNOUNCED?

Once the debate is finished, the speaker will read out the name of the first amendment and ask those in favor of it to shout “aye”, and then those against “no”. As long as some lawmakers shout “no”, the speaker will call a formal vote, known as a division.

Votes are registered by lawmakers walking through different doorways, out of sight of television cameras and onlookers. Once the headcount is complete, lawmakers return to the debating chamber. The four appointed tellers will assemble in front of the speaker, and one will read the result out loud.

This procedure is repeated for each individual amendment selected by the speaker, and then the main motion is put to a vote using the same process.

WHAT HAPPENS IF MAY LOSES?

If May loses the vote, she is required by parliament to come back within three working days with a motion setting out her next steps. The deadline for this would be the end of Monday Jan. 21.

Some media have reported May would ask parliament to vote again on the deal. May’s office has said she would respond quickly to any defeat, but has not set out how.

Some lawmakers have floated the idea that parliament could, in a temporary break to convention in Britain, take control of the process away from the government and hand it to a committee of senior lawmakers from across the political spectrum.

With 117 of her party’s 317 lawmakers having voted against her in a confidence vote in December, she is also likely to come under pressure to resign.