LONDON (AP) — The leaders of Spain and the UK met Wednesday in London to sign a cooperation deal that aims to strengthen post-Brexit ties between the two countries. It follows a recent agreement over Gibraltar, the contested territory at the tip of the Iberian peninsula.

Greeting his Spanish counterpart Pedro Sánchez in his offices at 10 Downing Street, Prime Minister Keir Starmer spoke of the close ties between the two countries. Sánchez commended Starmer and his government for breaking the post-Brexit deadlock on Gibraltar.

The new bilateral agreement is aimed at strengthening cooperation on economic growth, migration and other shared interests. It comes after the U.K. and Spain brokered a deal in June to remove border checks at Gibraltar over the summer, alongside the European Union.

When Britain left the EU in 2020, the relationship between Gibraltar and the bloc was unresolved. Talks on a deal to ensure people and goods can keep flowing over the Gibraltar-Spain border previously had made only halting progress.

In Britain’s 2016 Brexit referendum, 96% of voters in Gibraltar supported remaining in the EU. The tiny territory on Spain’s southern tip depends greatly on access to the EU market for its 34,000 inhabitants.

Both leaders also spoke about the Israel-Hamas war, with Starmer describing it as a “terrible situation.” Sánchez, who was the first European leader to accuse Israel of committing genocide in Gaza, called Europe’s response to the conflict a “failure” ahead of the meeting.

____

This story has been corrected to show that the agreement on the contested territory of Gibraltar was reached in June.