Maine will be required to repay the federal government millions of dollars that it has used to run Riverview Psychiatric Center during the past year, a federal official said.

The state has continued to draw federal money to operate the 92-bed hospital even though Maine lost its standing with Medicaid in September after the hospital failed to meet minimum patient safety standards.

“We will be seeking the return of that money because the facility has been decertified,” Richard McGreal, associate regional administrator for the Centers for Medicare and Medicaid Services, told the Press Herald this week.

Riverview lost its certification for a number of reasons, including for incidents when sheriff’s deputies used stun guns and handcuffs on patients. A June report again highlighted serious problems at Riverview, including medication errors, improper record-keeping and failure to track patient progress. The issues must be corrected before Riverview can be re-certified.

About half of the patients at the Augusta hospital have been sent there by the courts.

McGreal said his office is preparing a formal disallowance letter to Maine, although there’s no specific timeline for doing so. The formal action will require that Maine pay back federal money dating to September 2013 and will forbid the state from accessing future federal money for the psychiatric center unless Riverview regains its certification.

If Riverview becomes certified, federal money will flow back to the center. But McGreal said, even then the center would not be funded retroactively, and Riverview will still owe the federal money it has used in the months it was ineligible.

State officials said they have not been told of the pending disallowance action and have been drawing from the federal account the entire time. Maine is entitled to $20 million per year in federal money to operate Riverview, representing more than half of the hospital’s $36 million budget. It’s unclear if Maine was drawing the entire $20 million. An April 4 letter from McGreal to Maine Health and Human Services Commissioner Mary Mayhew shows that, for the quarter ending Dec. 31, Maine had taken $3.5 million in Medicaid money.

“We have not been notified that CMS will require the funding to be paid back,” John Martins, Maine Department of Health and Human Services spokesman, wrote in an email response to questions.

McGreal said, however, that Maine officials are “well aware” of his agency’s position that any money taken from federal coffers while Riverview was decertified had to be repaid.

“The state believes they have a legal standing to draw down the money for the facility,” McGreal said. “We have our opinion, and they have their opinion.”

Mayhew did not return phone calls on Thursday.

But Trish Riley, an adjunct professor at the University of Southern Maine’s Muskie School of Public Service, said that state officials should have realized that any funding used for a decertified facility is only a stopgap to keep the place running while it works to become re-certified.

“You take that money with the understanding that you’re going to have to pay it back,” said Riley, who was director of health policy and finance under former Gov. John Baldacci. “Federal funds cannot be used to pay for decertified facilities.”

The only way the state could recover the money is if it wins an appeal, determining that federal officials should never have decertified the psychiatric center to begin with.

An administrative law judge in January refused to hear Maine’s appeal, ruling that the appeal as filed did not challenge the substance behind why Riverview lost its certification.

Maine has “offered no evidence to show that those findings were incorrect and it has not represented that it would offer such evidence if given the opportunity to do so,” according to Administrative Law Judge Steven Kessel.

The Maine attorney general’s office has appealed Kessel’s decision, arguing that the state submitted proper correction plans, followed federal rules and made improvements to the center.

A recent request by Riverview to be re-certified with fewer beds was denied after inspectors found additional problems.

Meanwhile, Maine ended the 2013-14 fiscal year with a $39 million surplus, and the Legislature recently set aside $20 million for Riverview in case federal funding was not available. That money would become available only if the LePage administration requests it.

Democratic House speaker Mark Eves said that the administration has expressed confidence that it would retain the federal money and win its appeals.

“I don’t share that confidence,” Eves said. “I don’t think this is going to end well.”