David Cameron is looking at options for unprecedented legal action against Spain over the imposition of "politically motivated and disproportionate" border checks with Gibraltar, Downing Street has said.

It follows Madrid's decision to increase border controls at the Spanish border, which have led to delays of several hours for those travelling to and from the British overseas territory.

The move was greeted with disdain in Madrid, where the foreign minister said Spain would not back down on the border controls, which it regarded as proportionate.

Downing Street is examining options through the European courts which will force the Spanish government to stop hindering the free movement of people across the border with Gibraltar, the prime minister's spokesman said.

"The prime minister is disappointed by the failure of the Spanish to remove the additional border checks this weekend and we are now considering what legal action is open to us."

"This would be an unprecedented step and so we would want to make [any decision] carefully before making the decision."

He added: "If we go down this route we will certainly press the EU to pursue this as a matter or urgency. They need to de-escalate this issue by the removal of border checks. We feel that these delays are politically motivated and disproportionate. That would be illegal under EU law and contrary to the right of free movement.

"The British ambassador in Madrid will be talking to the Spanish today about the legal action."

Asked whether the government was considering other forms of intervention in the light of the expected legal action, the spokesman said there were other options but declined to say what they were.

The plan follows reports that the Spanish foreign minister, José García-Margallo, is expected to propose that Spain and Argentina present a united front over Gibraltar and the Falkland Islands.

El País newspaper said García-Margallo will sound out his Argentinian counterpart, Héctor Timerman, during a meeting in Buenos Aires next month as he prepares for a "180-degree turn in policy towards the colony", the newspaper said.

Argentina has a two-year term as a non-permanent member of the UN security council and could potentially use its position to put discussions about Gibraltar on the agenda.

The Argentinian president, Cristina Fernández de Kirchner, used a meeting of the council this week to renew demands for talks over the sovereignty of the Falklands.

Spain is also considering the possibility of raising the matter of Gibraltar at the UN general assembly or the international court of justice at The Hague, diplomatic sources reportedly told El País.

Thousands of Royal Navy personnel set sail on Monday for a training deployment in the Mediterranean amid the diplomatic tensions between the UK and Spain over Gibraltar.

The helicopter carrier HMS Illustrious left Portsmouth naval base in Hampshire and will join the navy flagship HMS Bulwark, which has sailed from Devonport for the Cougar 13 operation.

Also sailing on Tuesday will be HMS Westminster, a type 23 frigate, which will visit Gibraltar en route.

Other UK ships taking part are another type 23 frigate, HMS Montrose, and six Royal Fleet Auxiliary (RFA) ships.

The vessels will be taking part in what defence officials stressed was a long-scheduled deployment in the Mediterranean and the Gulf.

Political tensions in the region flared after the British territory began work on a concrete reef in the Mediterranean, which Spain claims will destroy fishing in the area.

The Spanish government is also considering a €50 (£43) fee to cross the border into Gibraltar.

Downing Street thought Cameron had won an assurance from the Spanish prime minister, Mariano Rajoy, that the controls would be lifted when they spoke last week.

The spokesman said that was still their understanding of the conversation, but the British interpretation has been challenged by Madrid.

The news follows Boris Johnson's provocative intervention in the row, in which he compared the actions of the Spanish government over Gibraltar to the "Franco epoch" and said he hopes the UK will "prise Spanish hands off the throat of our colony".

In a strongly worded article in the Daily Telegraph, the mayor of London said increased border checks imposed by Madrid were tantamount to a blockade and called on the Spanish government to "stop it all, and pronto".