delivered the opinion of the Court:
By a long and well-known series of cases in the Supreme Court of the United States, from that of Marbury v. Madison, 1 Cranch, 137, to that of Roberts v. United States, 176 U. S. 221, the law of mandamus has been well settled, so far as it concerns the authority of the courts of the District of Columbia to issue that writ to the head of a department of the Federal Government or the chief of a bureau upon whom some special duty has been devolved by law. These decisions have firmly established the doctrine that the writ of mandamus will be issued to compel the performance of a ministerial duty by such officer, but that it will be refused when the duty required of him involves the exercise of judicial or quasi-judicial discretion. The only difficulty in any given case now is the application of the doctrine, and the determination of the question whether thq act of which the performance is sought, is of a ministerial or of a judicial character. That question is greatly simplified in the present case by the concession of the demurrer of the appellee that the. facts, stated by the relator in his petition and which constitute the foundation of the relator’s cause of action, are true as therein stated.
It is conceded that the relator has taken all the steps and complied with all the requirements of the law to entitle him to his allotment; and it is not controverted that he is a proper person to receive the allotment. It is true that he is not a native member of the Indian tribe, but only an adopted member. But no question is made as to this either in the brief or in the oral argument on behalf of the appellee, and none well could be made in view of the well-established custom of the Indians for over two hundred and fifty years to admit white men into membership of their *343several tribes by tbe process of adoption, and in view of tbe uniform recognition of this custom by the Government of tbe United States. Tbe sole defense interposed by tbe appellee to tbe relator’s right in tbe premises is tbe proposition that tbe cause is one wherein tbe Secretary of tbe Interior was required to exercise judgment and discretion, that tbe control of Indian affairs is a political function vested by Congress in tbe Executive branch of Government, that tbe power to approve in this instance involved tbe power to disapprove, that this necessarily implies tbe exercise of judgment, that tbe refusal of tbe Secretary to approve tbe allotment amounts to a disapproval and rejection of it, and that any attempt to control bis judgment therein would be an exercise of appellate power which is not given to tbe courts.
"We think that this proposition in tbe present case is based upon a misapprehension of tbe law and cannot be sustaix ed.
Tbe fact that an act which mandamus seeks to compel is tbe culmination of a series of proceedings of a judicial or quasi-judicial nature, or is an act in tbe course of such proceedings, does not exempt it from judicial control by tbe courts through tbe writ of mandamus, when tbe officer or person chai’ged to perform it, arbitrarily and without just legal cause refuses such performance. This is so even in reference to strictly judicial proceedings. Eor a trial court to settle a bill of exceptions or to approve an appeal bond is a judicial function inquiring tbe exercise of judgment and discretion; and yet, if tbe judge bolding tbe trial court arbitrarily refuses to settle such bill of exceptions, when in due form it has been duly tendered to him, or arbitrarily refuses to approve such appeal bond, when it has been duly submitted to him for approval and is in all respects satisfactory and subject to no reasonable objection, it is elementary law, which requires no elaboration and no citation of authority for its support, that, while bis judgment may not be coerced, tbe performance of bis duty may be required of him by means of tbe writ of mandamus. Indeed, it may be laid down as a general rule, that, while tbe judg*344ment of a judicial officer or of an officer charged with the performance of a judicial or quasi-judicial duty, will not be controlled through the writ of mandamus, and this writ will not be used as a means for the review of the exercise of such judgment, yet any act required by law to be done, whether in the course of judicial proceedings or otherwise, may be compelled by mandamus from a superior tiibunal, or a tribunal of g'eneral jurisdiction, as the case may be, when its performance is withheld by a mere arbitrary exercise of power without just cause. There is not a step in the course of judicial proceeding which may not be the subject of mandamus, when its performance is unlawfully refused.
Now, if this be the case in strictly judicial proceedings, it is even more so in regard to the functions of executive officers in the performance of acts wherein individual citizens are interested. To grant a patent for lands, or for an invention in the arts or for a discovery in the sciences, is a quasi-judicial function of the highest nature, which has been committed by Congress to the executive officers of the Government; and the granting or refusal of such a patent ordinarily cannot be questioned in the courts. But when all the proper prerequisites have been complied with, and all the preliminary steps have been taken whereby a party has in law become entitled to a patent, and nothing remains to be done but to issue the patent, it is well settled that such patent may not then arbitrarily and without just cause be withheld, and that its execution and delivery may be enforced by the writ of mandamus. Butterworth v. Hoe, 112 U. S. 50; United States v. Schurz, 102 U. S. 378; Dunlap v. Black, 128 U. S. 40. It has been well said that, under our republican system of government, there is no place for the exercise of arbitrary power..
It is not to be denied that, in the administration of the law the provisions of which it is sought here to enforce, a certain amount of discretion is reposed in the Secretary of the Interior and the officers of the land office under his control. But that discretion has been expended. It is con*345ceded by tbe pleadings in this case that the relator has done everything required by the statute to be done by him; that he is a proper person to receive the allotment which he seeks; that his selection of land is right and proper; that such selection infringes no other right, and that there is no reason whatever why his selection should not be approved. We may infer, of course, that there is some secret reason for disapproval not disclosed in the record; but if such secret reason there be, the courts can take no cognizance of it. The only ground whatever of objection set up to the writ is, that the case is one involving the exercise of judgment and discretion on the part of the Secretary. But the plain answer to this argument is that the judgment and discretion have been exercised, and that the only thing which now remains to be done is the final expression of that judgment, as in the case of Butterworth v. Hoe, supra, by the execution and delivery of a certificate of approval, which, in contemplation of law, is a purely ministerial duty.
It is not sought to control the judgment of the Secretary in any matter calling for the exercise of judgment. It was for him to determine whether the relator was within the category of persons entitled to an allotment of land, whether the land selected was of the kind which the relator was entitled to select, whether it interfered with the rights of any other persons, and all other preliminary matters going to the validity or invalidity of the relator’s action. But it is admitted by the pleadings that all this was done, and that no question whatever in that regard remains to be determined; and the legal interpretation of the action of the department is that, although the relator has been adjudged to be entitled to receive his allotment, approval is ai’bitrarily withheld and no cause whatever is assigned for the refusal — not even a plausible, although insufficient cause, as in the case of Butterworth v. Hoe.
Now, if in the case of an appeal bond, it were admitted that the bond were regular and sufficient in every respect and that the sureties were satisfactory, and the sole ground for withholding refusal was that the judge had the power *346to approve or disapprove, and therefore an exercise of discretion in the matter, we apprehend that he could be required by mandamus to give his approval. And we find no greater amount of discretion involved in the duty which is sought to he enforced here.
The history of adjudication on the subject of mandamus is sufficient to show that the courts should he cautious not to interfere with the independent freedom of action guaranteed by the Constitution and the laws to- the executive officers of government; but it is also sufficient to show that the writ of mandamus will be freely resorted to in order to enforce individual right against arbitrary action, however well intended such action may he, when the relator has no other available remedy. Roberts v. United States, 176 U. S. 221.
In view, therefore, of the concessions made by the demurrer in this case, we must reverse the order appealed from, and remand the cause for further proceedings therein according to law.
But it is proper here to state that we cannot commend the practice, which has lately grown up in the District, of making return to a writ of mandamus, or rule to show cause why the writ of mandamus should not issue, by a demurrer to the petition upon which the writ or rule to show cause has been issued. This practice, although in accordance with that of several of the States of our Union, is not wholly consistent with the provisions of the Statute of 9 Anne, Ch. 20, regulating the proceedings in mandamus, the substance of which, it may be noted, has been embodied in the new code for this Distinct, Secs. 1273-1282. The act of Anne, equally with the new code, contemplates a return or answer to the writ, not a demurrer to the petition; and it contemplates that in this return or answer all the facts shall be stated upon which the respondent proposes to rely. It does not contemplate that he shall keep back any of the facts, by relying first on a demurrer to the petition and then falling hack upon an answer, which would he proper enough in ordinary cases, hut not in proceedings in mandamus. *347Logically, the rule to show cause is not answered by demurring to the petition in pursuance of which the rule has been issued. The petitioner may plead to or traverse the return; and his pleading may take the shape of a demurrer; and there may be a replication and demurrer to a plea or replication; but a demurrer would seem to have no proper place in the proceedings until the coming in of the return to the rule to show cause.
The return should be an answer or statement of facts showing the grounds upon which the respondent has acted or refused to act. It may state the facts in part or in whole by denying or admitting the allegations of the petition, or by qualifying or explaining them; but it should in some way state all the facts necessary and proper for the determination of the cause.
If this course had been pursued in the present cause, it would have been unnecessary to send the cause back for further proceedings. We have now no option but to do so.
The order appealed from will therefore he reversed, with costs; and the cause will be remanded to the Supreme Court of the District of Columbia, with directions to overrule the respondent’s demurrer, and for further proceedings therein according to law. And it is so ordered.