MADRID — Spain was on Friday hailing what diplomats described as a historic victory in the fight over Gibraltar — thanks to a six-letter word at the bottom of a document.

“Gibraltar is a colony of the British Crown,” reads a footnote in a draft regulation approved by the Council of the EU on visas for Brits after Brexit.

Spanish diplomats say it’s the first time the EU has endorsed in a written text Madrid’s three-centuries-old claim over the sovereignty of the Rock, as well as proof that the EU will be on Spain’s side in the dispute.

“There is a controversy between Spain and the UK concerning the sovereignty over Gibraltar, a territory for which a solution has to be reached in light of the relevant resolutions and decisions of the General Assembly of the United Nations,” the Council text reads.

A Spanish diplomat involved in the negotiations said his side is “satisfied” with the text and added that “Gibraltar is a colony and the EU backs that … this is the basis of our claim.”

“Gibraltar is not a colony and it is completely inappropriate to describe in this way" — Spokesperson for the U.K. government

The diplomat, however, denied that Madrid would seek to obtain concessions from the U.K. immediately, for example by stopping London postponing the date of Brexit past March 29 — a move that would require the backing of all the EU27.

A spokesperson for the U.K. government said “Gibraltar is not a colony and it is completely inappropriate to describe in this way,” adding that the Rock is “part of the U.K. family and has a mature and modern constitutional relationship with the U.K.”

Spain’s push to include the “colony” line in the text is consistent with its diplomatic strategy during the Brexit negotiations. Madrid has sought to use Brexit to gain leverage in the dispute while postponing a direct push for sovereignty.

In November, Prime Minister Pedro Sánchez threatened to derail the divorce deal between the U.K. and the EU until he obtained written promises from Brussels and London that Madrid would have a "veto" over whether the treaty on the future relationship would be applied to Gibraltar.

That same month, the Spanish leader told POLITICO in an interview that he would put on the table the issue of “shared sovereignty” over Gibraltar during the Brexit negotiations, saying it is "something we need to talk about.”

Earlier, London and Madrid reached a deal on Gibraltar that was added to the Withdrawal Agreement between the EU and the U.K. — effectively guaranteeing that Gibraltar's situation would remain the same during any transition period.

Both capitals also signed four bilateral memorandums of understanding (MOUs) on citizens’ rights and other issues, and have discussed a treaty on tax regulation.

But with EU capitals and the U.K. stepping up preparations for a no-deal Brexit, Madrid wants to make sure that nothing changes if the U.K. crashes out of the bloc.

An internal memo from the Spanish government on Brexit preparations delivered to lawmakers — a copy of which has been seen by POLITICO — states that contingency measures being drafted at the EU level for a no-deal scenario “won’t be applied to Gibraltar.”

If that happens, it would mean the territory becoming reliant on Madrid’s goodwill for whatever kind of emergency measures are needed to deal with the consequences of a chaotic no-deal Brexit.

Foreign Minister Josep Borrell on Wednesday referred to the issue in a speech in Congress: “This reinforces the thesis of the Spanish government … future deals between the EU and the U.K. over Gibraltar will need the agreement of Spain.”

“Those agreements, which were important with an agreed Brexit, will be even more important under a no-deal Brexit" — Josep Borrell

Borrell, however, tried to dispel fears that the situation would lead to trouble for workers, particularly Spanish ones, crossing the frontier between Gibraltar and Spain every day, adding that the MoUs signed with London will come into force even in the case of a no-deal.

“Those agreements, which were important with an agreed Brexit, will be even more important under a no-deal Brexit,” Borrell said, arguing that there will be a need for bilateral agreements “and we already have bilateral agreements on some very important topics.”

"We’re committed to maintaining the substance of the MoUs and we remain committed to concluding a tax treaty,” said a spokesperson for the U.K. government in a statement, adding: “U.K. and Spanish officials, together with the Government of Gibraltar, had positive and constructive discussions on this in London on 9 January.”

Gibraltar was captured by an Anglo-Dutch force during the War of the Spanish Succession in 1704. Madrid ceded it officially in perpetuity in the Treaty of Utrecht in 1713. In 1946, the U.N. Committee on Decolonization included it in a list of non-self-governing territories, together with Hong Kong, Macao and the Falkland Islands.

An agreement for shared sovereignty of Gibraltar was discussed between former British Prime Minister Tony Blair and his Spanish counterpart José María Aznar in the early 2000s — and was overwhelmingly rejected by the people of Gibraltar in a referendum in 2002.

"The Spanish repeatedly say that they want Gibraltar to become Spanish, while here is good evidence that the Gibraltarians don't even want to countenance that possibility," Gibraltar's Chief Minister Fabian Picardo told the BBC in an interview Friday, describing Madrid's actions as "unnecessarily provocative."

The U.K. government has repeated its commitment to respect the wish of Gibraltar’s people to remain British.