The Gibraltar government condemned as "provocative and unlawful" an incident on Tuesday in which it said a Spanish naval vessel incurred into its territorial waters and then called on commercial ships to leave the area.
Tensions in the disputed waters off the tiny British territory were already high since an incident on April 23 involving Spanish and Gibraltar police vessels.
A British military spokesman in the rocky promontory off southern Spain said the Royal Navy issued two radio warnings to the Spanish patrol boat "Atalaya" to leave after it entered the area on Tuesday morning.
The Royal Navy then dispatched a fast inflatable boat followed by a bigger, armed vessel, HMS Scimitar, the spokesman said. He said the Atalaya left about 90 minutes after it arrived.
The Gibraltar government also charged that "the Spanish vessel approached and contacted all merchant shipping on the eastside of the Rock within British Gibraltar Territorial Waters and ordered them to raise anchors and to leave since they did not have permission to be in Spanish waters.
"The Gibraltar Port Authority directed all vessels to remain at their anchorage, which they did," it said in a statement.
The Gibraltar government "condemns the provocative and unlawful actions by the Spanish Navy Corvette 'Atalaya' in British Gibraltar Territorial Waters."
There was no immediate comment from Madrid to the charges.
It was the latest in a series of maritime face-offs in the waters off Gibraltar over the last two years.
The most recent occurred on April 23, when Gibraltar police charged one of its boats was damaged in a clash with Spanish police vessels that illegally entered its waters in pursuit of alleged drug traffickers.
Spain's government complained to Britain over that incident, while Spain's Civil Guard police force charged its officers were subjected to "insults and threats" by those on the Gibraltar police boat.
In a similar incident to Tuesday's, a Spanish navy patrol boat entered Gibraltar waters in May 2009 and inspected fishing boats.
Britain claims a strip of three nautical miles (5.5 kilometres) surrounding Gibraltar as its territorial waters. But Spain does not recognise any waters off Gibraltar as belonging to the territory apart from its ports.
Gibraltar, which Madrid ceded to London in 1713 under the Treaty of Utrecht, has long fuelled tensions between the two countries.
Madrid argues the 6.5-square-kilometre (2.6-square-mile) territory that is home to around 30,000 people should be returned to Spanish sovereignty.
But its people overwhelmingly rejected an Anglo-Spanish proposal for co-sovereignty in a referendum in 2002.