The Supreme Court exposed states and the federal government yesterday to billions of dollars in potential liability for failing to pay hospitals reasonable reimbursement for their costs of treating Medicaid patients.

The ruling came in a lawsuit brought by the Virginia Hospital Association, which sued state officials for higher reimbursements, claiming its members were losing more than $1 million a week by providing health care for the poor. The hospitals said the state had failed to meet its responsibility under the Medicaid statute to provide "reasonable and adequate" reimbursement.

In a 5 to 4 decision, the court said health care providers such as hospitals and nursing homes have the right to sue in federal court for higher payments.

Hospital officials in more than a dozen other states have brought similar suits alleging that Medicaid reimbursement programs do not begin to cover the steeply rising costs of providing medical assistance to the 20 million to 30 million Americans who rely on them. In a friend-of-the-court brief in the case, Wilder v. Virginia Hospital Association, 37 states warned that allowing such suits could expose them to "liability easily running into the hundreds of millions of dollars."

The Bush administration, siding with the states, said, "Such an explosion of litigation would vastly increase the cost of the Medicaid program, to the detriment of both state and federal government, and to the ultimate detriment of Medicaid recipients."

But hospitals and nursing home groups argued that the quality of care they could provide under the inadequate reimbursements would suffer, or they would be forced to cover their losses by imposing higher charges on other patients if they were not allowed to challenge nding levels in federal court.

"The decision should greatly benefit the poor," Duke University law professor Walter Dellinger said yesterday. He argued the case on behalf of the Virginia Hospital Association.

Virginia Deputy Attorney General Claire Guthrie emphasized that the ruling involves a "procedural question about the right of Medicaid providers" to sue in federal court and "says nothing about what the rates should be or whether Virginia meets the standards."

Although a ruling the other way "would have ended a whole lot of pending litigation" in Virginia and elsewhere, she said, "This decision only says to us, 'Let's go to trial.' " The case is scheduled to start Dec. 17. Guthrie said the state's rates are reasonable under the statute.

Congress established the Medicaid program to ensure that poor people receive a basic level of health care. Every state has different funding formulas and benefits, but the federal government -- which splits the cost of the program with states -- requires them to provide "reasonable and adequate" reimbursement for Medicaid costs so long as the hospitals operate "economically and efficiently."

Frustrated by shrinking budgets and growing demands for social welfare and hospital costs, state officials have said they simply cannot manage to pay all the bills. Hospitals that handle large numbers of Medicaid patients, in turn, have cut back on many essential services such as emergency room treatment, obstetrics and the purchase of expensive new equipment.

In the decision yesterday, Justice William J. Brennan Jr. upheld the right of the hospitals to sue under a Reconstruction-era civil rights law known as Section 1983, which allows suits for "the deprivation of any rights, privileges, or immunities secured by the Constitution and laws" of the United States.

In a dissenting opinion, Chief Justice William H. Rehnquist said the decision "virtually ignores the relevant text of the Medicaid statute" and had opened the door to claims by health care providers who "will inevitably seek the substitution of a rate system preferred by the provider for the rate system chosen by the state."

Justices Sandra Day O'Connor, Antonin Scalia and Anthony M. Kennedy joined the dissent.