In a case that could affect millions of Medicaid patients, a federal judge ruled Friday that Michigan can continue a prescription drug program that requires doctors to use a list of discounted drugs when treating low-income patients who get state aid.

U.S. District Court Judge John Bates dismissed the claims of drug companies and mental health advocates, who said Michigan acted illegally by proceeding with its program without the full approval of Health and Human Services Secretary Tommy Thompson.

"The secretary did not act arbitrarily, capriciously, or otherwise not in accordance with the law in approving portions of the initiative," Bates wrote.

Bates said Congress has given states "broad room" to establish prior-authorization prescription drug programs, which require doctors to get state permission to use drugs not on the list. Bates also said drug manufacturers failed to show that Michigan was acting illegally when it demanded even lower rates than those generally given to states.

"Any negotiation between a state and a manufacturer operates against a backdrop where there is already an agreement between the (Health and Human services) secretary and the manufacturer in place; both parties know that if negotiations fail, the rebate level in the secretary's agreement will apply," Bates said.

Michigan Department of Community Health Director Janet Olszewski said she was thrilled with the decision. "It affirms everything we have been saying for a long time," she said.

Bruce Lott, a spokesman for the Pharmaceutical Research and Manufacturers of America, didn't immediately return a telephone message seeking comment.

The state and federal government argued that Michigan had to proceed with the program because of the state's budget crisis. Michigan spends about $1 billion a year on prescriptions for low-income patients; the state says its preferred drug list will save about $42 million per year.

Michigan's year-old prescription drug program requires doctors to use a list of discounted drugs when treating the estimated 1.6 million patients who get state aid. Drug companies must provide discounts to have their drugs listed.

The Michigan Court of Appeals also upheld the program in a state lawsuit that was resolved in December.