PORTLAND, Maine — A federal judge on Thursday ruled that Maine’s Department of Health and Human Services missed the deadline to appeal a decision intended to cut off Medicaid reimbursement for patients at Riverview Psychiatric Center in Augusta.

Riverview lost its certification from the federal Centers for Medicare and Medicaid Services in September 2013 due to a range of issues, the most serious of which involved the use of Tasers and restraints on patients.

Since then, funding has continued to flow to Maine but if the hospital is not recertified, it risks losing millions in reimbursement money. The state could also be asked to repay the approximately $20 million per year it has received since the decertification went into effect Sept. 2, 2013.

The deadline for the state to appeal the termination or to request an extension to appeal the decision was 60 days after June 4, 2013, the date on the letter informing Riverview that reimbursement would be terminated Sep. 2, 2013.

U.S. District Judge John Levy said Thursday in his 16-page ruling the state’s argument that a letter dated Sept. 27, 2013, about a corrective plan of action revived its right to appeal the termination decision “stretches the facts of this case, and the relevant statutory and regulatory language, beyond their limits.”

DHHS Commissioner Mary Mayhew, who has argued since 2013 the decertification is unfair, called the decision “extremely disappointing.”

“While we are working daily to make sure that mentally ill Mainers have timely access to quality hospital services, the federal government is fixated on a bureaucratic battle with Maine over regulatory technicalities that jeopardizes Maine’s safety net hospital for the mentally ill,” she said in a statement.

“This kind of ‘regulatory scheme,’ as Judge Levy called it, is the reason people are so frustrated with government,” Mayhew continued. “It’s time for the feds to stop letting arcane regulations get between mentally ill Mainers and the resources they need, and start acting as a partner with the LePage administration in maintaining access to these critical hospital services.”

Riverview lost its certification from the federal Centers for Medicaid and Medicare Services in September 2013 due to a range of issues, the most serious of which involved the use of Tasers and restraints on patients. Riverview houses both civilian patients and those referred for treatment by the Department of Corrections and judicial system, many of whom were involved in violent crimes but found not responsible because of mental illness.