The district court has exclusive original jurisdiction in all cases of mandamus, except where such writ is to be directed to a district court or a judge thereof in his official capacity, in which case the supreme court has exclusive original jurisdiction, and in such cases the supreme court or a judge thereof shall first make a rule, returnable in term, that such district court or judge thereof, show cause before the court why a peremptory writ of mandamus should not issue, and upon the return day of such rule such district court or judge may show cause against the rule by affidavit or record, evidence, and upon the hearing thereof, the supreme court shall award a peremptory writ, or dismiss the rule. In case of emergency, a judge of the supreme court, at the time of making the rule to show cause, may also appoint a special term of the court for hearing the motion, and at which the rule shall be made returnable.
NMS § 44-2-3