A Spanish court has ordered the interception of two US boats should they leave Gibraltar, amid a row over treasure from a shipwreck.
Odyssey says it kept the location secret for security reasons
A judge in Cadiz instructed police to capture the ships if they entered Spanish waters, Spanish media said.
Odyssey Marine Exploration, which owns the ships, recently said it had found $500m (£253m) in coins from a wreck somewhere in the Atlantic Ocean.
Spain has launched legal action amid rumours it was found off Spain.
The two ships, Odyssey Explorer and Ocean Alert, belonging to the Florida-based firm, are berthed in the British overseas territory.
The salvaged booty has already been flown back to the US from Gibraltar.
The haul has already been flown back to the US
Spanish radio said Spanish Civil Guard police would be posted off Gibraltar to prepare for the ships' departure.
Culture Minister Carmen Calvo said the judge's ruling was "magnificent news" and that the navy would help if required.
"International laws are behind us and if anything outside the law occurred it will have an answer, and what is ours will return to Spain," Ms Calvo told the Efe news agency.
Spain has launched legal action over the wreck, which has been described, speculatively, as a 17th Century vessel found off the coast of England.
However, Spain reacted to rumours that it was found off its waters by instructing lawyers to recover any "property of the Kingdom of Spain recovered from sunken ships".
Spanish media have reported that Odyssey Marine Exploration vessels had been seen with flags denoting they were undertaking marine research in Spanish waters in recent months.
Odyssey's co-founder Greg Stemm has denied any wrongdoing.
It said it had kept the location secret for security and legal reasons.