The Spanish government has threatened to reject Theresa May’s Brexit deal over the issue of Gibraltar, demanding that last-minute changes be made to the text ahead of a crunch summit.

The country’s foreign minister said Spain would not back the proposals at the European Council unless it received assurances that the agreement would not apply to Gibraltar.

But Downing Street said it would not exempt Gibraltar or any other British territory from the agreement – putting the two governments on a collision course ahead of the meeting this weekend.

“The negotiations between Britain and the EU have a territorial scope that does not include Gibraltar, the negotiations on the future of Gibraltar are separate discussions,” Spanish foreign minister Josep Borrell said on Monday morning in Brussels.

“This is what needs to made clear, and until it is clarified in the withdrawal agreement and in the political declaration on the future relationship, we cannot give our backing.”

Spain has long resented Britain’s claims on Gibraltar, a British overseas territory that is home to around 30,000 people, and has previously threatened to use Brexit to wrest concessions on the issue.

The Gibraltar issue is also controversial with the Spanish public, with successive governments benefiting politically by grandstanding on the matter.

The withdrawal agreement has to be approved by qualified majority voting at the European Council this weekend, meaning that if other countries add their voices of dissent to Spain’s, the agreement could be in trouble.

Additionally, last year Spain got a special clause included in the council’s Brexit guidelines stating that “no agreement between the EU and the United Kingdom may apply to the territory of Gibraltar without the agreement between the Kingdom of Spain and the United Kingdom”. This was widely interpreted at the time as a veto.

The bloc has so far publicly stressed its unity in dealings with the UK, though it is understood that some other countries have problems with the future relationship proposals – fearing too many concessions may have been granted to Ms May’s government.

Countries understood to have voiced concerns in private include Denmark, Belgium, and the Netherlands, who were annoyed that the UK was given an EU customs union as part of the backstop without a formal agreement guaranteeing they retain fishing rights on British waters. France has reportedly joined with those countries to push for stronger demands on that issue and on guaranteeing the UK cannot roll back on environmental, social, and labour standards.

Diplomats familiar with the situation suggested the changes could be accommodated by so-called “side-declarations” that would avoid reopening talks on the agreement but give clear stipulations about how the EU expected it to be interpreted.

“We do not expect any reopening of the [withdrawal] agreement but we will be very vigilant about its implementation,” Nathalie Loiseau, France’s EU affairs minister, said.

Spain also has an absolute veto over any future trade deal between the EU and UK – an issue on which it would be possible for the country to make trouble down the line.

Until it is clarified in the withdrawal agreement and in the political declaration on the future relationship, we cannot give our backing Josep Borrell, Spanish foreign minister

Pedro Sanchez, the Spanish prime minister, had previously said in October that the issue of Gibraltar was resolved and “will no longer be a problem”.

However, at the time he also said Britain and Spain were still holding separate bilateral talks regarding Gibraltar, focusing on matters such as workers’ movements across the border, environmental issues and tax affairs.

Last month the sideline negotiations about the territory were said by the British side to be “95 per cent there”.

If the Spanish government does manage to reopen the withdrawal agreement, the changes will inevitably draw protests from Brexiteers – who also want to change it, but have been told they must live with the document as it is currently constituted.

Spanish representatives are understood to have explicitly demanded amendments to Article 184 of the agreement at a meeting of European affairs minister in Brussels.

Cabinet ministers resign over Brexit deal Show all 13 1 /13 Cabinet ministers resign over Brexit deal Cabinet ministers resign over Brexit deal Esther McVey Britain's Work and Pensions Secretary Esther McVey arrives to attend the weekly meeting of the cabinet at 10 Downing Street in London. - Britain's Work and Pensions Secretary Esther McVey resigned from the cabinet over draft Brexit deal AFP/Getty Cabinet ministers resign over Brexit deal Handout image taken from the Twitter feed of @EstherMcVey1 of the resignation letter addressed to Prime Minister Theresa May from Works and Pensions Secretary Esther McVey. PRESS ASSOCIATION Photo. Issue date: Thursday November 15, 2018. Ms McVey has resigned, saying the Brexit deal âdoes not honour the result of the referendumâ. See PA story POLITICS Brexit. Photo credit should read: @DominicRaab/PA Wire NOTE TO EDITORS: This handout photo may only be used in for editorial reporting purposes for the contemporaneous illustration of events, things or the people in the image or facts mentioned in the caption. Reuse of the picture may require further permission from the copyright holder. PA Cabinet ministers resign over Brexit deal Dominic Raab British Brexit Secretary Dominic Raab give a press conference at the end of the final round of talks in Brexit negotiations at the European Commission in Brussels, Belgium EPA Cabinet ministers resign over Brexit deal Handout image taken from the Twitter feed of @DominicRaab of the resignation letter addressed to Prime Minister Theresa May from Brexit Secretary Dominic Raab. PRESS ASSOCIATION Photo. Issue date: Thursday November 15, 2018. Mr Raab has resigned, saying he âcannot in good conscience support the terms proposed for our deal with the EUâ. See PA story POLITICS Brexit. Photo credit should read: @DominicRaab/PA Wire NOTE TO EDITORS: This handout photo may only be used in for editorial reporting purposes for the contemporaneous illustration of events, things or the people in the image or facts mentioned in the caption. Reuse of the picture may require further permission from the copyright holder. PA Cabinet ministers resign over Brexit deal Rehman Chrishti Vice Chairman of the Conservative Party Rehman Chrishti tendered his resignation letter this afternoon PA Cabinet ministers resign over Brexit deal Cabinet ministers resign over Brexit deal Anne-Marie Trevelyan Parliamentary private secretary in the Department of Education Anne-Marie Trevelyan resigned stating that she cannot support the deal Cabinet ministers resign over Brexit deal Handout image taken from the Twitter feed of @annietrev of the resignation letter addressed to Prime Minister Theresa May from Anne-Marie Trevelyan, a parliamentary private secretary in the Department for Education. PRESS ASSOCIATION Photo. Issue date: Thursday November 15, 2018. Ms Trevelyan has resigned saying she cannot support the Brexit deal after negotiations âbuilt on the UK trying to appease the EUâ. See PA story POLITICS Brexit. Photo credit should read: @annietrev/PA Wire NOTE TO EDITORS: This handout photo may only be used in for editorial reporting purposes for the contemporaneous illustration of events, things or the people in the image or facts mentioned in the caption. Reuse of the picture may require further permission from the copyright holder. PA Cabinet ministers resign over Brexit deal Sam Gyimah Universities minister Sam Gyimah resigned on November 30, claiming the government's decision to pull out of the EU's Galileo satellite navigation system as a deciding factor PA Cabinet ministers resign over Brexit deal Shailesh Vara Shailesh Vara who has quit as Minister of State for Northern Ireland, saying he cannot support Theresa May's Brexit agreement, which he said "leaves the UK in a halfway house with no time limit on when we will finally be a sovereign nation" PA Cabinet ministers resign over Brexit deal Cabinet ministers resign over Brexit deal Suella Braverman Brexit minister Suella Braverman has resigned, stating “It is not what the British people, or my constituents, voted for in 2016.” Cabinet ministers resign over Brexit deal Ranil Jayawardena Parliamentary private secretary to the ministry of justice Ranil Jayawardena resigned as he could not back the deal "in good conscience"

But a Downing Street spokesperson ruled out any kind of concessions, telling reporters: “The draft withdrawal agreement agreed last week covers Gibraltar.

“The prime minister has been clear that we will not exclude Gibraltar or the other overseas territories or the crown dependencies from our negotiations on the future relationship. We will get a deal that works for the whole UK family.”