If oil companies had prevailed, the state could have been ordered to reimburse them tens of millions of dollars in royalty collections, said Leonard Herzog, an assistant attorney general.

The Supreme Court, in a 23-page opinion released Friday, upheld a lower court ruling and a decision by the state's Natural Resources commissioner that oil companies Conoco Phillips, Exxon Mobil and Forest Oil were not entitled to a "discovery" royalty rate for drilling into the Midnight Sun reservoir in 1997.

Normally, the state receives a 12.5 percent royalty, or share, of oil produced from leases on state land. However, regulations designed to encourage oil development provide for a deeply discounted royalty rate for newly discovered, oil-rich geologic structures.

In this case, the reduced royalty rate would have applied not only to the relatively small amount of oil produced from the Midnight Sun reservoir but also some oil from the prolific Prudhoe Bay oil field, Herzog said. That's because the oil companies held a lease on acreage covering both fields, which are stacked one atop the other at different depths.

State officials argued that Midnight Sun was not a new discovery but part of a known oil-bearing structure known as the Kuparuk C sandstone formation.

The oil companies applied for the lower discovery royalty rate in 1999. After the commissioner ruled that they did not qualify, the companies appealed to the state Superior Court and the Supreme Court.

"We are disappointed with the decision, but we will abide by the ruling of the court," said Dawn Patience, spokeswoman for Conoco, the state's top oil producer.

The Midnight Sun reservoir is a "satellite" on the edge of the Prudhoe Bay field. It started production in October 1998 and reached a peak output of 14,500 barrels a day. Its production today is less than a third of that.

Conoco and Exxon are the two biggest owners, each holding a 36 percent stake.