The European Union removed the last major obstacle to sealing an agreement on Brexit after Spain said it had reached a deal Saturday with Britain over Gibraltar on the eve of an E.U. summit. British Prime Minister Theresa May, who arrived in Brussels Saturday for preparatory talks with E.U. leaders, will then have the momentous task of selling the deal to a recalcitrant Parliament and a nation still fundamentally split over whether the U.K. should leave the E.U. on March 29 and under what conditions.

Spanish Prime Minister Pedro Sanchez announced that Madrid would support the Brexit divorce deal after the U.K. and the E.U. agreed to give Spain a say in the future of the disputed British territory of Gibraltar, which lies at the southern tip of the Mediterranean nation.

May hopes to leave E.U. headquarters on Sunday with a firm agreement on the withdrawal terms for Britain’s departure on March 29, as well as a comprehensive negotiating text on how future relations should look once both sides agree on a trade agreement.

Winning warm greetings from her 27 fellow leaders on Sunday might be much easier for May these days than getting such treatment from her colleagues in government and Parliament once she returns. May is under intense pressure from pro-Brexit and pro-E.U. British lawmakers, with large numbers on both sides of the debate opposing the divorce deal and threatening to vote it down when it comes to Parliament next month. The leader of Northern Ireland’s Democratic Unionist Party, on which May relies to get her government majority, on Saturday rejected her planned Brexit deal, arguing it would drive a wedge between Northern Ireland and the rest of the United Kingdom.

Associated Press