The American company that discovered the lost ship with what may be history's richest sunken treasure has signed an agreement with the British government, which owns it, to raise it from the bottom of the Mediterranean and split the proceeds.

The agreement is a legal breakthrough that could open the way to the recovery of perhaps up to $4 billion in gold coins that went down with H.M.S. Sussex in a violent storm in 1694, and of dozens of sunken vessels in seas around the world.

The company, Odyssey Marine Exploration Inc. of Tampa, Fla., found what British authorities believe to be the Sussex during four expeditions off Gibraltar from 1998 to 2001. The exploratory work was done with British approval, and the discovery tentatively announced last February. But until now there has been no legal precedent for a private company to join with a government to raise its treasure.

As new technologies open up the deep sea, the maritime superpowers of present and past -- notably Spain, Portugal, Britain, France, the Netherlands, Russia and the United States -- have begun to assert ownership over thousands of ships that were lost in distant waters.

But little has come of the claims because the governments often lack the money and skills to pull sunken treasure and cultural riches from the depths, and they have struck no major deals to let commercial partners share the risks and rewards.

The new agreement, which is being announced by Britain on Monday, changes that. The Ministry of Defense, the sunken ship's official owner, calls it ''an important step in development of a 'partnering' approach to deep-sea archaeology.''

Experts say it could end the days of freelance treasure hunting and start a time when nations oversee the recovery of their own lost fleets. They praised the agreement for requiring cultural artifacts to be handled according to contemporary archaeological standards.

The British say the Sussex, the flagship of a large flotilla, carried a fortune in treasure to buy the loyalty of a shaky ally in a war against France. In darkness half a mile down, the site where it is believed to lie consists of a large mound rich in cannons, anchors and other artifacts -- the only such objects found anywhere near the area where the Sussex was reported lost.

''We're fairly convinced it's the Sussex,'' a senior British official said in an interview. ''And we're very excited to be working with Odyssey. We really want to see this succeed.''

American experts, echoing the British assessment, say the accord is unique. ''It's the first time we're seeing a profit-making group doing this kind of recovery,'' said Anne G. Giesecke, an marine adviser to the Society for Historical Archaeology, a professional group. Robert C. Blumberg, a senior policy adviser at the State Department, called the agreement ''a public-private partnership where both sides stand to gain.''

Months of detailed negotiations delayed the accord until Sept. 27, British and Odyssey officials said. The government said the agreement would ''extend to recording and preservation of artifacts and their eventual conservation, publication, exhibition, marketing and all other facets relating to the management of our underwater cultural heritage.''

Odyssey considers the agreement a coup and a model for a new era. ''We see a whole industry emerging,'' said Greg Stemm, a founder of the company. ''The private sector will routinely help governments in managing their marine heritage. It's already a huge industry on land.''

The company, which is publicly traded, is risking its own money in the venture: $4 million so far and up to $4 million for excavation work with an eventual total of tens of millions of dollars, much of it for marketing the treasure, Mr. Stemm said. Both sides agree that the ship carried coins, most likely gold, that were worth £1 million in 1694. In weight, that would be about nine tons. The $4 billion figure comes from the theoretical value of the coins if sold to collectors, which the company says it cannot predict.

The partnership is to split the profits or appraised values of the recovered coins on a sliding scale that favors Odyssey at first and then the government. Odyssey is to get 80 percent of the proceeds up to $45 million, 50 percent from $45 million to $500 million and 40 percent above $500 million. The British government gets the rest.

The agreement calls for archaeological integrity -- a difficult technical feat at such depths and a goal that critics of for-profit archaeology are likely to dispute. Many archaeologists abhor the sale of recovered artifacts, saying it inhibits scholarly analysis and public display.

The partnership agreement draws a distinction between classes of artifacts, saying cultural items have a greater archaeological value than coins, which it allows to be sold to help pay for the project.

Mr. Blumberg of the State Department praised the approach as allowing the saving of wrecks that otherwise would deteriorate over time and be lost to history. Academic archaeologists, he said, had little money for the investigation of deep-sea artifacts. ''If you have a thousand gold coins and they're virtually identical in every respect that you can discern,'' he asked, ''why shouldn't you keep a representative sample for a museum and let the rest be sold?''

In recent years maritime countries have occasionally recovered shipwrecks from their shallow coastal waters. Sweden lifted the Vasa, a 17th-century warship, and Britain the Mary Rose, a 16th-century warship. This summer, the United States lifted the gun turret of the Monitor, a 19th-century ironclad.

In the case of distant waters, the governments often turned a blind eye to shallow-water treasure hunters. Spain took no action in 1985 when Mel Fisher found the Atocha, a galleon lost off Florida in 1622, and recovered about $400 million in treasure.

The stakes and costs have soared in recent years as robots, sonars and other advanced gear have opened every corner of the deep to exploration and recovery, bringing thousands of lost ships into play.

So governments have begun to assert ownership over their vessels, especially warships.

In 2000, Spain won a legal battle over the issue when a federal appeals court in Virginia ruled that it owned the remains of two warships lost off the Virginia coast two centuries ago. The ruling snatched the ships away from a treasure hunter, who estimated that the wrecks bore more than half a billion dollars in coins and precious metals.

In a new disclosure about the Sussex, the British statement said the ''considerable economic loss to the nation led to the foundation of the Bank of England,'' which bailed out the government with a loan.

In keeping with British practice, the 30-page agreement is being kept secret. But the British have released a summary memorandum. It specifies such things as the licensing fees Odyssey must pay, the profit breakdown and how a project plan must be completed in 100 days.

''The government,'' it says, ''may appoint two representatives to monitor and record the exploration to determine whether the activities are being carried out in compliance with the project plan.''

The agreement also says the British government will receive ''10 percent of any net income derived from intellectual property rights associated with the project,'' as well as 3 percent of Odyssey's ''gross sales of merchandise that utilizes the name H.M.S. Sussex.''

The partner approach, officials said, was adopted to avoid expensive court battles and to allow experts to devote more time to recovering lost history.

''To its credit,'' the statement said, ''the company decided to work with British officials rather than resort to standard salvage practices.''

Photos: Greg Stemm, a founder of Odyssey Marine Exploration, with an artifact from a 17th-century ship.; The H.M.S. Sussex sank off Gibraltar in 1694. The search for the ship during four expeditions from 1998 to 2001 was aided by new technologies, top, that allow for surveys of the seabed, 3,000 feet deep. (Photographs by Odyssey Marine Exploration) Map of Spain highlighting the search area near Gibraltar.