Minn. Stat. § 589.14
The judge shall immediately send the petitioner back to the detaining authority if it appears that the petitioner is detained in custody:
(3) for contempt of court, specially and plainly charged in the commitment, by a court having authority to commit for the contempt so charged.
The judge shall also immediately send the petitioner back to the detaining authority if it appears that the time during which the person may be legally detained has not expired.