In a way, it’s a shame that James Goold of Covington & Burling isn’t a historical novelist.

He’s come up with some great fodder, like the story of Captain Diego de Alvear. In 1804, as Spain girded for war with England in the ever-shifting enmities of the Napoleonic era, Spain assembled a four-ship squadron to transport gold and silver from Peru, then a Spanish territory, to Spanish coffers. At the last minute, the second-in-command of one of the ships, the Medea, fell ill, so de Alvear was transferred to the Medea from another ship, the Mercedes. The rest of his large family — his wife, three sons, four daughters, and a nephew — stayed aboard the Mercedes as the ships sailed from South America to Spain. One day before the squadron was due to reach port in Cadiz, the British Navy intercepted the ships. The Spanish Navy refused to surrender, touching off what became known as the Battle of Cape Saint Mary, a pivotal moment in the history of the Spanish Empire. As de Alvear watched from the Medea, British artillery struck the Mercedes. The ship exploded. De Alvear’s entire family disappeared, along with scores of Spanish sailors, chests of treasure, and two ancient bronze cannons, destined to be melted down and recast as modern weapons.

Of course, Goold would never have come across the tragic story of Diego de Alvear if it weren’t for his real job. The Covington counsel has carved out one of the most interesting microniches I’ve ever run across: he represents foreign sovereigns in disputes with commercial treasure hunters over the rights to shipwreck recoveries. On Wednesday the U.S. Court of Appeals for the Eleventh Circuit, in a 53-page opinion that cites the de Alvear story, ruled that the Foreign Sovereign Immunity Act bars U.S. courts from hearing a case involving rights to treasure that a company called Odyssey Marine Exploration recovered from the site of the 1804 Mercedes explosion. The three-judge appellate panel didn’t decide who owns the treasure — which Odyssey has estimated to be worth $500 million — but the ruling in effect grants it to Spain, since the court ordered the booty to be transferred to Spanish custody.

This is the third time Goold has won such a ruling for a foreign sovereign. (He told me that in several other cases, treasure hunters backed off claims before courts reached a decision.) Even with that history, though, the Mercedes investigation was particularly thrilling. According to Goold, Odyssey was very secretive about its excavation of the site, in an operation it code-named “Black Swan.” Through international military and diplomatic sources, Spain (and Covington) learned that the Black Swan operation was taking place in the waters off Gibraltar, where the Mercedes went down, and that Odyssey had transported a Gulfstream filled with gold and a Boeing 757 filled with silver to Florida.

Odyssey insisted it didn’t know what ship was the source of the treasure, since no vessel was recovered. Spain, which suspected Odyssey had found the Mercedes wreckages, was able to obtain Gibraltar’s records of what the treasure hunter recovered from the sea bed. Covington also found the ship’s manifest Mercedes had filed in Montevideo, Uruguay, the ship’s last port before it blew up. The manifest cited the two ancient bronze cannons Mercedes was carrying back to Spain — one of which Odyssey had recovered from the site. That and other evidence, such as the dates on the coins Odyssey recovered, led Spain to conclude that Odyssey was pulling up wreckage from the Mercedes explosion.