Spanish Prime Minister Pedro Sanchez would not decide whether to attend a Brexit deal signing summit until he has seen the promise, a senior official told reporters.
“We have demanded that it be published by the British authorities before the European Council on Sunday,” said state secretary Luis Marco Aguiriano Nalda.
Specifically, he said London must say it shares the view of EU negotiators that Spain must green light any post-Brexit deal with the European Union that involves Gibraltar.
Madrid has a long-standing claim on the British rock, home to 30,000 people, and a series of bilateral disputes on tax, smuggling and the environment.
After Britain leaves the EU on March 29, London and Brussels plan to negotiate an accord to govern trade and relations after a transition period.
But Spain has threatened to hold up a summit planned for Sunday to sign a withdrawal deal unless its right to veto Gibraltar-related measures is recognised.
Aguiriano said that in 11th-hour talks in Brussels on Friday the other 26 European Union members and the EU Commission had agreed with this interpretation.
He said that British officials had said they share this view, but that: “We are therefore waiting to see that statement in writing.”
Earlier, Downing Street said that the withdrawal agreement itself would not be reopened.
But a Number 10 spokesman said: “We will work with the government of Gibraltar and Spain on our future relationship.”