EU President Donald Tusk announced in a tweet that leaders of 27 remaining EU member states "endorsed" the plans to break off from the EU.
Sanchez was due to make a statement in Madrid on Saturday to outline the agreement, diplomats said, after British and Spanish negotiators talked through the night with European Union officials trying to broker a deal that would reassure Madrid on how the Brexit treaties would apply to Gibraltar and give it a clear say on their application - without reopening the texts.
The leader of Northern Ireland's Democratic Unionist Party, on which May relies to get her government majority, on Saturday reinforced her party's rejection of the Brexit deal.
"Europe and the United Kingdom have accepted the conditions imposed by Spain".
The backstop deal would only cover trade in goods and agri-products, where the European Union enjoys a massive export surplus with Britain, and not services, where Britain enjoys a surplus with the EU.
In the days before the summit, some states raised objections regarding the content of the withdrawal agreement, including over the issue of fishing rights in the UK's territorial waters post-Brexit.
She says several things could happen in that case, including a new referendum on Brexit, new elections in the United Kingdom, or a request to renegotiate the deal with the EU.
On November 21, Theresa May's Brexit deal suffered a setback after Spain threatened to veto her draft divorce agreement over the handling of Gibraltar.
Deadline for civil service to trigger no-deal contingency planning, which is still a possible outcome. He said the deal as it stands "has ceded too much control" to Brussels.
Pro-EU Conservative and former GP Sarah Wollaston said it was "deeply shocking" that the prime minister restated the discredited NHS funding claim.
European Commission president Jean-Claude Juncker warned Theresa May she can not expect to get a better deal if MPs vote down her plan. Asked for her preference, she said only: "We would like to see everything settled as soon as possible".
Foreign Minister Augusto Santos Silva says that the original Brexit guidelines laid out previous year that included assurances to Spain that it could deal with London directly on the issue of Gibraltar were "wise".
Prime Minister Theresa May has appealed to the public to get behind the agreement, arguing it is the best deal she could have struck and honours the result of the Brexit referendum. Unlike the withdrawal agreement, which will be legally binding after it is approved by British and European parliaments, the political document is loosely worded and aspirational, an outline for future talks, which will likely take years to complete.
"In this tragic and sad situation, what is good is that we have gone down a hard path with this withdrawal agreement and that should give us assurance and strength so that we can sort out the future relations too".
May was quick to correct her Spanish counterpart, saying: "The UK's position on the sovereignty of Gibraltar has not changed and will not change".
Spain's Prime Minister Pedro Sanchez delivers a speech during a visit to Havana, Cuba.
Arlene Foster said in Belfast on Saturday that the deal agreed by Prime Minister Theresa May is unacceptable and must be improved upon in the weeks ahead.
But Spanish officials are concerned that a key clause in the agreement referring to U.K. -EU negotiations on their future relationship makes no mention of Gibraltar. Though the United Kingdom would formally withdraw in March 2019, it would remain under European Union regulations throughout the transition.
May hopes to leave Brussels on Sunday with the terms of British withdrawal on March 29 and a comprehensive concept for future Britain-EU relations settled with the bloc.
"This isn't about me", she said.
The British government wrote to Mr Tusk to say that it would not interpret its withdrawal treaty as meaning that a future EU-UK trade treaty would automatically apply to Gibraltar - but it would seek the best deal for the territory.