The Odyssey Explorer, a 250ft salvage vessel, was trying to leave Gibraltar, where it had been effectively blockaded for three months after Spain claimed a share of millions of dollars worth of gold and silver coins it had recovered. After setting sail, it was approached by a Spanish navy gunboat and civil guard patrol ship once it passed the three-mile "buffer zone" that surrounds Gibraltar and forced to turn round and head for the Spanish port of Algeciras. "We were forced at gunpoint to come to Algeciras," said Ali Nessar, a company representative on the boat.

Following a stand-off, the boat was boarded and searched for information that Spanish authorities hope could lead to the site of the treasure.

The captain of the Odyssey Explorer, Sterling Vorus, was arrested last night for disobeying orders and was facing the night in jail.

The row centres around Odyssey Marine Exploration, run by Greg Stemm, the world's leading underwater treasure hunter. His company trawls the ocean's floors, looking for sunken treasure, which it then sells to collectors. Founded in 1994, its first major success came with the recovery of $75m worth of booty from the SS Republic, which sank off the coast of Florida in 1865. But now it has come up against the Spanish government in a diplomatic tussle that is costing the company millions of dollars in lost revenue.

In May Odyssey spirited away what it subsequently claimed were $500m worth of silver and gold coins that it found in international waters in the Atlantic Ocean. The coins were flown out of Gibraltar airport and are now sitting in an undisclosed location in Tampa, Florida, where Odyssey is based. The Spanish government believes they were transported with the complicity of the British and that the coins may belong to Spain. Odyssey and the governments of Britain and Gibraltar deny any foul play, saying that Odyssey flew the treasure out from the airport in full compliance with customs requirements.

Spain has filed a suit in Tampa against Odyssey to clarify the details of its discovery, to prevent future recovery efforts and to claim back what has already been discovered. But the company refuses to reveal specific information about the treasure, admitting only that it was found around 180 nautical miles west of Gibraltar. Mr Stemm argues that as "custodians" of the site - which Odyssey has named the Black Swan - they have a responsibility to protect it from other interested parties, including potential treasure hunters.

Mr Stemm says Odyssey is keen to "learn the name of the ship from which we removed the treasure," but that they may "never be able to establish [its] identity". Spain counters that the company's lack of transparency reveals their intention to make a financial profit from its national heritage. The coins are believed to be Spanish, but Odyssey argues that this does not necessarily mean that they came from a Spanish ship. The Spanish "real de a ocho" (piece of eight) was the international currrency of the day and could have ended up on any shipwreck, says the company, which has invested millions of dollars in their recovery.

There is debate over the value of the coins. In export licence applications made to Gibraltar in May the company valued the 500,000 coins at $2.5m (around $5 per coin), but in a press release put out by Odyssey in June, they said the coins may be worth $500m, or $1,000 per coin, making it the world's largest shipwreck recovery. Odyssey said it was not responsible for the higher valuation, based on calculations by an independent numismatist. But they did publicise the higher figure.

Spanish media reports suggest the boat from which the coins were recovered is the Nuestra Señora de las Mercedes, which sank off the coast of Portugal in 1804 after a battle with British warships. Down with it went more than 1m silver coins, plundered from Spain's American colonies. The treasure has entered into Spanish lore as the world's greatest sunken booty and the idea that it might have been whisked away has incensed politicians and journalists.

The battle is unlikely to be resolved on the high seas, but in the Tampa courtroom. Odyssey describes its work as "commercial archaeology" and says that, as the treasure was found in international waters, it should keep 90% of the proceeds. Spain's lawyer, James Goold, counters that "Spain has not abandoned its sunken property and it does not permit unauthorised salvage".