On the 14th day of January, 1881, the petitioner made application to the Hon. H. O. Seeake, judge of the eighth judicial circuit, alleging that he was illegally restrained of his liberty, by being confined in the jail of Madison county, under sentence of the Circuit Court, and praying for a writ of habeas corpus. The writ was granted instanter, and was served the same day on the sheriff, commanding him to bring the body of the relator before the judge on the 17th January, 1881, with the cause of such detention. On the day designated, the sheriff made his return in due form, but failed to. produce the body of petitioner; alleging, as an excuse therefor, that he was not in his custody, or under his power, control or restraint; that he had been convicted in the Circuit Court of Madison county, and sentenced to hard labor for said county, and, being subject to. the control of the Court of County Commissioners, had, by their order, been delivered, since the service of the writ, to their agent, W. J. Franks. The petitioner moved the judge to grant an order to the sheriff, compelling him to produce his body before the judge; which was refused. He here applies for a mandamus, to compel the granting of such order.
It seems to be settled by the decisions of this court, that if a prisoner is brought in person before a judicial officer, on habeas corpus, and such officer refuses to hear and decide on the evidence adduced touching the relator’s guilt, mandamus will lie to compel a hearing. The only acts, however, to which the power of the superior court extends by this remedial writ, are such as are purely ministerial, and in the performance of which no judgment or .discretion is required. When the power sought to be controlled involves the exercise of such judgment or discretion, it is judicial, and not ministerial.—Ex parte Mahone, 30 Ala. 49; Ex parte Echols, 39 Ala. 698; Ex parte Harris, 52 Ala. 87; High on Ext. Bern. § 266. And the power of the superior court is exhausted, when it requires the court below to hear and consider the evidence, without undertaking to compel the rendition of any particular judgment or decision. — lb. § 266.
We think, in the present case, the issuing of the order to produce petitioner’s body, under the circumstances prayed for, was not a ministerial act, but was judicial in its nature. The decision of the judge, either granting or refusing it, required him to determine the sufficiency of the sheriff’s return to the writ, the practicability of his performing such order, if issued, or whether the granting of it would be fruitless in its results. Under such circumstances, the inferior tribunal must be left untrammeled in the exercise of such power, with *136which it is vested by law. — High on Extr. Rem. § 155-6; Ex parte Harris, 52 Ala. 87; Davidson v. Washburn, 56 Ala. 597.
In Ex parte Graves, 61 Ala. 381, it was expressly decided, that mandamus was not the proper remedy to compel a court or magistrate to discharge a petitioner, alleged to be improperly restrained of his liberty, under process issuing from such court or magistrate. Manning, J., said : “ The writ of mandamus is never issued to correct errors in, or to reverse, the judicial action of a court. By that process, inferior courts or magistrates, when they fail or refuse to do so, will be compelled to entertain and exercise jurisdiction. They will not be controlled in the manner of its exercise, nor directed as to what judgment they will render.”
We áre of opinion, furthermore, that the decision of the circuit judge, refusing the order in question, was correct, in view of the return of the respondent' to the writ of habeas corpus ; which showed that the body of the prisoner was not then in his custody, or under his power and control, and that it was impracticable for the sheriff to recover such control as to enable him to obey the mandate of the court, even had it been issued. — Code (1876), § 1951.
“ It is a fundamental principle of the law of mandamus, that the writ will never be granted in cases where, if issued, it will prove unavailing. And whenever it is apparent to the court that the object sought is impossible of attainment, either through want of power on the part of the persons against whom the extraordinary jurisdiction of the court is invoked, or for other sufficient cause, or that the granting of the writ would necessarily be fruitless, the court will refuse to interfere.” — High on Extr. Rem. § II; Com. v. Supervisors, 29 Penn. St. 121.
It must, in other words, be fatal to every such application, where the uncontested facts show, satisfactorily and clearly, that it is practically not within the power of the respondent to perform the act required. The solemn mandate of a court of justice should never be invoked to an end that is obviously useless.—People v. Hoyt, 66 N. Y. (21 Sick.) 606; People v. Supervisors, 15 Barb. 607; 4 Wait’s Act. & Def. p. 377, § 1.
It is plain that, without the production of the body of the relator, the writ was without practical effect — the case had no status, and the court could hear no evidence upon the question of the legality of the alleged detention, except in those particular cases specially authorized by the statute. Com. v. Chandler, 11 Mass. 83; Code (1876), § 1953.
This view is in harmony with the statute, which prescribes the remedy to be pursued in case the writ is eluded, by transferring the body of the petitioner to the custody or control of *137another, pending the application. The respondent, in such case, forfeits the sum of five hundred dollars to the party-aggrieved, and is declared guilty of a misdemeanor, being subject to fine and imprisonment in the event of conviction. Code (1876), § 4969. He is, furthermore, liable to attachment for contempt of the process of the court, within the-proper discretion of the judge, who possesses an inherent, power to punish a corrupt or willful neglect or refusal to-obey the writ, or to compel obedience to its mandate promptly and completely, when practicable. And each court or judge must, of necessity, be the sole arbiter of whether such contempt has been committed or not. — Code, §§ 542-44.
The prayer of the relator for the writ of mandamus is. refused.