Traffic is flowing normally at the Gibraltar-Spain border after three days of delays due to increased vehicle searches by the Spanish authorities.
The Foreign Office says the delays stopped after Foreign Secretary William Hague called his counterpart in Madrid.
Spain has lodged a complaint with the UK over the creation of an artificial reef in the waters off Gibraltar.
Gibraltar said the delays were linked to the reef. Spain says it has a duty to prevent smuggling.
On Monday morning, the Royal Gibraltar Police tweeted there were no queues to leave Gibraltar and a "normal queue" to enter.
A Foreign Office source told the BBC the issue was primarily one for the governments of Gibraltar and Spain, but after long queues built up the foreign secretary called the Spanish foreign minister and the British ambassador in Madrid raised concerns.
A Spanish government statement said: "Spain is fulfilling its duties under European law to monitor its borders and to abide by rules set up to avoid the illegal traffic of illicit goods and prevent smuggling."
Spain disputes UK sovereignty over Gibraltar, a limestone outcrop on the southern tip of the Iberian peninsula, which has been ruled by Britain since 1713.
On Friday and Saturday, Spanish customs officers stopped thousands of vehicles trying to leave Gibraltar for Spain. On Sunday the delays switched to traffic trying to enter the British territory.
There were delays of nearly six hours for those leaving Gibraltar on Saturday in temperatures of 30C (86F).
Gibraltar's Chief Minister Fabian Picardo said Spanish border officers were "just trying to create a delay by pretending to search" vehicles.
He told the BBC that Spain was "bullying" Gibraltar in response to the artificial reef, which was made by placing concrete blocks in the sea on Wednesday and Thursday.
There has been tension between Spain and Gibraltar over fishing rights, and Mr Picardo said the reef had been built to "prevent Spanish fishermen fishing in a manner that is contrary to our law".
A resident of Gibraltar, David Gibbins, told the BBC Saturday's delays had meant the territory - which has a population of under 30,000 - had been "gridlocked".
He said border guards had been "checking every bit of paperwork", which he said did not normally happen.
Alfred Ballester, founder of the social network group GibBook.com said a protest was held outside the governor of Gibraltar's house after Spanish border guards arrested a cyclist.
Mr Ballester said cyclists can normally go to the front of the border crossing queue, but in this case the man was told to go to the back and was arrested when he reportedly questioned why he was being made to go to the back of the queue.
The Gibraltar government said the delays had affected tourists and thousands of people who go in and out of the territory every day to work.