The federal government does not always get to be first in line among creditors when trying to collect unpaid taxes from a dead taxpayer's insolvent estate, the Supreme Court ruled Wednesday.

The unanimous decision in a Pennsylvania case said a 1966 federal statute limits the effect of a 1797 law that gave a government's claims first priority when a deceased person's estate could not pay all its debts.The 1966 law says a federal lien for back taxes is not valid until the government files proper notice of the debt with state or local officials. That law reflects "an obvious attempt to accommodate the strong policy objections to the enforcement of secret liens," Justice John Paul Stevens wrote for the court.

Wednesday's ruling upholds a Pennsylvania Supreme Court decision that said federal tax collectors were not entitled to be paid first from the estate of Francis J. Romani.

In 1985, Romani was ordered by a Pennsylvania state court to pay $400,000 to Romani Industries, Inc.

Some time later, the Internal Revenue Service filed notices of federal tax liens on Romani's property, seeking about $490,000 for unpaid taxes through the 1980s.

Romani died in 1992, and the administrator of his estate sought to transfer its only asset - a building worth about $53,000 - to Romani Industries to pay his debt to the company.

The IRS objected, contending it was entitled to be paid first under a 1797 federal law that says any U.S. claim against an insolvent estate "shall be paid first."

But the Pennsylvania Supreme Court ruled for Romani Industries. The court said the case should be governed instead by the 1966 law that said the government's tax lien was not valid until it filed proper notice.

The Supreme Court agreed.

The ruling comes as the Senate Finance Committee is holding hearings this week on the inner workings of the IRS.