Image caption Motorists trying to cross from Gibraltar into Spain have experienced long delays

The UK government is considering legal action against Spain over the imposition of additional border checks in Gibraltar, Downing Street has said.

A spokesman said the prime minister was "very disappointed" by Spain's failure to remove the checks over the weekend.

Legal action through the EU would be "unprecedented", the spokesman added.

The Spanish government, which has said its checks are essential to stop smuggling, said it would not relax border controls.

Spain said it had an "obligation" to police the border, and insisted its controls were legal and proportionate.

A government spokesman also said Spain was considering taking the dispute to the UN Security Council, where it could seek the support of Argentina.

He told the BBC that although the Falkland Islands - over which Britain went to war with Argentina - and Gibraltar were different issues, there were similarities between the two disputes.

The issues to be raised at the UN could include disputed waters, Britain's failure to comply with previous UN resolutions and the disputed stretch of land which links Gibraltar and Spain, he said.

'Matter of urgency'

The row was sparked after Gibraltar created an artificial reef which, the Spanish say, will destroy fishing in the area.

This would be an unprecedented step so we want to consider it carefully before a making a decision to pursue Downing Street spokesman

Madrid stepped up border controls, which caused lengthy traffic queues, and suggested a 50 euro (£43) fee could be applied to every vehicle entering or leaving the British territory.

A Downing Street spokesman called Spain's actions "disproportionate and politically motivated".

Speaking about potential legal action, he said: "If we go down this route, we would press upon the EU the need to pursue this with a matter of urgency."

It is not clear what the legal options were, the spokesman added, saying it would be up to the EU to explain any possible sanctions.

"This would be an unprecedented step so we want to consider it carefully before a making a decision to pursue," he said.

Conservative MEP Ashley Fox, who represents south-west England and Gibraltar, said Spain's actions were motivated by political and economic weaknesses in the country, not a "fishing dispute" with Gibraltar.

He said "harassing" Gibraltar was intended to take public focus in Spain off domestic issues.

The BBC's diplomatic correspondent James Robbins said the next step could be a formal complaint to the European Commission in Brussels, where it could be argued that Spain was in breach of European Union law by preventing free movement.

Image caption HMS Westminster is due to visit Gibraltar before heading for the Middle East

After that, Britain could eventually take a case to the European Court of Justice, he said.

"Gibraltar, a British overseas territory, is part of the EU. In essence, border checks are permitted, because neither Britain nor Gibraltar are part of the Schengen group of countries which have ended border checks, but still any checks regarded as excessive could be illegal," he added.

Last week the European Commission said it would send a team of monitors to the border to examine the situation, but they are not expected to arrive until next month or October.

Drivers in Gibraltar have reported waiting up to seven hours at the border in recent weeks, with the longest queues forming at weekends.

'Felt like criminals'

Marie Fox told the BBC she was stuck in a three-hour queue on Saturday to cross into Spain.

"I had a three-year-old and seven-year-old in the car and temperatures were soaring," she said.

"Everyone was beeping and hooting. Elderly people were out of their cars because they couldn't stand the heat."

She added: "My husband and I had to get out of the car and stand in front whilst guards inspected it. We felt like criminals. I refused and followed him around. He didn't really check much.

"I've lived here since I was seven - I'm 35 now. I've always commuted across the border with no problem."

Posting on Twitter on Sunday, the Royal Gibraltar Police said there was a two-hour queue to enter the British territory, with Spanish officials "checking every car". On Monday evening they tweeted that there were "no queues to enter or exit".

Meanwhile, a Royal Navy taskforce has started to leave UK ports on a routine deployment. One of its ships - HMS Westminster - will stop in Gibraltar.

Although it comes amid the diplomatic dispute between the UK and Spain, both countries have described the deployment as "routine", and at least one of the ships is expected to visit the Spanish port of Rota.