The Foreign Office has made a formal complaint after a British diplomatic bag was opened and searched by Spanish Guardia Civil officers on the border with Gibraltar.
The incident, which occurred on Friday, was described by a Foreign Office spokesman as a "serious infringement" of the Vienna Convention on Diplomatic Relations.
"Diplomatic bags are inviolable," the spokesman said. Officials are now seeking assurances from the Spanish that there will be no repeat of the incident, which follows months of tension between London and Madrid over the British overseas territory.
The British embassy in Madrid has also made a "formal diplomatic protest" to Spain's Ministry of Foreign Affairs and and requested that it investigate the incident.
The bag was searched when a courier was taking it across the border from Gibraltar into Spain, according to The Gibraltar Chronicle.
No explanation has been given as to why it was being carried across the land border or why the Spanish authorities decided to open it. The Foreign Office refused to discuss the contents of the bag.
Diplomatic bags, which are used to transport documents and other items between governments and their diplomatic missions abroad are protected by the 1961 Vienna Convention on Diplomatic Relations.
The incident is the latest spat between Britain and Spain over Gibraltar. Earlier this month, the Spanish ambassador was summoned to the Foreign Office over what was believed to be an unauthorised incursion into Gibraltarian waters by a Spanish survey vessel.
The Foreign Office spokesman said: "This was a serious infringement of the principles of the Vienna Convention on Diplomatic Relations.
"There are long-established and internationally-accepted articles concerning official correspondence and the diplomatic bag to which the FCO adheres. We expect other parties to the Convention, including EU and Nato allies, to do the same.
"We take very seriously any reported abuse of the protocol surrounding official correspondence and the diplomatic bag. We have asked the Spanish authorities to investigate what occurred and take action to ensure it does not happen again.
"As far as we are concerned there is no justification for this infringement of the UK's rights under the Vienna Convention. Official correspondence and diplomatic bags are inviolable."
Additional reporting by Press Association