ALBANY — In a rare case that straddles the border between civil and criminal law, an appellate court yesterday upheld a civil contempt order against the State Attorney General’s office for violating an injunction barring criminal prosecution of a home care agency for Medicaid fraud.

The preliminary injunction was issued in a civil proceeding brought by the home care agency to challenge the validity of the Medicaid regulation on which the criminal prosecution was based.