U.K. Prime Minister Theresa May enjoyed a rare good day in Parliament, fighting off her opponents and winning the endorsement of British politicians to seek to delay Brexit day.

The result on Thursday means her Brexit plan -- which has twice been rejected by huge majorities in the House of Commons -- is still in play.

The House of Commons voted 412 to 202 to support May’s motion, which sets out how she will ask the European Union to extend the Brexit deadline from March 29 to June 30, if a deal can be reached by next Wednesday.

The motion also opens the door to a potentially much longer postponement. If no Brexit agreement is passed in another parliamentary vote by March 20, more time will be needed to find a solution and the U.K. will have to take part in European Parliament elections in May, it says. This is aimed at encouraging opponents to back her deal.

Thursday’s votes represent a welcome piece of good news for the British leader, after a bruising three days in which her political authority appeared to drain away. It means that her strategy to put her deal back to a vote in the Commons by March 20 remains on course.

Her escape was narrow. An earlier rebellion from her own side meant May only defeated an attempt to take control over what happens next out of her hands by the slimmest of margins. The proposal, from Labour politician Hilary Benn, was defeated by 314 votes to 312.

The EU has suggested it’s open to putting back the U.K.’s departure until late May, although there’s no unified position among European leaders and officials say they will need Britain to give a clear reason for delaying.