delivered the opinion of the Court r
It is first objected, on the part of the appellant, that there was error in the issuance of the writ in making it returnable before Justice Wright instead of the supreme court of the District to-which the application for the writ W'as made. This objection is *464based upon the terms , of the Code of ;the District, chapter 32, title. “Habeas Corpus.” , By § 1143 of the Code, it is provided that any person, being imprisoned, “may apply by petition to the supreme court of the District, or any .'justice .thereof, for a writ of habeas corpus, to the end that the cause of such commitment, .detainer, confinement, or restraint may be inquired into; and the court, or the justice applied to, if the facts ,,set forth in .the petition .make a prima .facie case,, shall forthwith grant such writ, directed to the .officer or.other person in whos.e custody or keeping, the party so. detained shall be, returnable forthwith before said, court or justice.” And by § -1148 it is provided that,, upon the -return of the writ, and the production of the person, “the court, or justice shall immediately inquire into, the legality , and propriety of such confinement or, detention, and, if it,shall appear that such person is detained without, legal warrant or authority, he shall immediately, be released or discharged ; or if the court or justice shall deem his detention to be lawful and proper, he shall be remanded to .the same custody,” etc.
It is quite obvious, we think, that the term “justice” is not intended to be synonymous with “court,” nor.“court” with the term “justice,” as used in; these sections of the Code. While clothed with the same power, the court, and, the justice are authorized tos act separately and distinct from, each other, in matter of habeas,corpus, as under the English habeas corpus act of 31 Car, II. chap 2. Hence, when an application is, made for the writ of habeas corpus, either to the court, or to a justice thereof, the return is-required, by the, terms of the statute,; to be made, not to the court simply, but before said court or justice by whose order the writ was issued. It was certainly never intended that a prisoner applying to the court composed of several judges, any .one of whom, not disqualified, being competent to act as and for the court, should be compellable to have the question of the legality of his imprisonment decided and disposed of by one of the justices of -the court, by whose predetermination and decision-the, party had been, upon full consideration, committed to and detained in prison. It is manifest, if the applica*465lion for the writ had been laid before Mr. Justice Wright he would not have granted the writ, and if that, apparently, would have been the disposition of the application by him, the writ, granted by another judge ought not to have been made returnable before the justice who had predetermined the case. The terms of the statute should be given a reasonable interpretation, in order to effectuate the object in view, and not to defeat that object. When the statute requires that, immediately upon the return to the writ and the production of the party detained, the court or justice should proceed to injuire into the legality and propriety of such confinement or detention, and if it should appear that such detention was without legal warrant or authority should at once discharge the party, such requirement could hardly have been intended to be addressed to the judge or justice who had heard and predetermined upon the sufficiency of the cause for the committal and detention of the party, and whose judicial act constituted the cause of grievance of which the party complains. Such a proceeding would seem to be nothing more in effect than a simple travesty of justice; and we are convinced that such a proceeding was never contemplated by the provisions •of the Code.
But this error in the issuance and return to the writ does not reach the vital and important question intended to be presented by this appeal. At most it would require the quashing of the writ and return, but that would leave the question of the legality of the imprisonment of the appellant undetermined.
The question, however, of the legality of the commitment and detention of the appellant, as for contempt of court, or because of his failure to answer the question propounded to him and required by the court to be answered, is presented by the appeal; and the appellant contends that, upon the facts as disclosed in the case, there was no sufficient warrant or authority for the commitment to and detention of the appellant in prison; that there was no contempt of court committed by him, and that he was in law fully justified in declining to answer the question which he was by the court required to answer; and therefore the order and commitment by the court, whereby the appellant was *466confined in jail, was null and void, for want of jurisdiction in tbe premises; and the appellant is entitled to be discharged from such unlawful imprisonment. These questions are raised by the demurrer to the return to the writ.
It is a settled principle that the writ of habeas corpus cannot be made to serve the purpose of a writ of error or of an appeal; and that under such writ mere errors or irregularities in the proceedings under which the applicant for the writ was imprisoned will furnish no ground for review and reversal of such proceedings. But where the commitment was made without jurisdiction of the court, or want of legal authority therefor, as in the case of a commitment for contempt of court where it is shown that there was no ground for the contempt charged, there, and in like cases, the court will, by writ of’ habeas corpus, discharge the prisoner. This is an established principle by a series of cases, in both English and American courts; and it finds clear and definite expression in several recent decisions of the Supreme Court of the United States. As for instance, in the case of Ex parte Fisk, 118 U. S. 713, 28 L. ed. 1117, 5 Sup. Ct. Rep. 724, in an opinion delivered by Mr. Justice Miller, after stating the general principle that the exercise of the power of punishment for contempts of their orders, by courts of general jurisdiction, is not subject to review by writ of error or appeal, or by writ of habeas corpus, that learned justice was careful to qualify this general principle by proceeding to declare that —
“When, however, a court of the United States undertakes, by its process of contempt, to punish a man for refusing to comply with an order which that court had no authority to make, the order itself, being without jurisdiction, is void, and the order punishing for the contempt is equally void. It is well settled now, * * * that when the proceeding for contempt in such a case results in imprisonment, this court will, by its writ of habeas corpus, discharge the prisoner.”
The same principle has been laid down in subsequent cases, as the settled law. Re Ayers, 123 U. S. 443, 485, 31 L. ed. 216, 223, 8 Sup. Ct. Rep. 164.
In the case of Holman v. Austin, 34 Tex. 668, the question *467involved was in effect the same as in the present case. In that ease, the question was whether the question asked the witness and which he refused to answer, was proper to be asked. For refusal to answer the question the witness was adjudged to be in contempt, and he w2as committed to prison. The court on habeas corpus determined, as matter of law, that the question was an improper one to be asked, and that the witness did not commit a contempt in refusing to answer it, and was therefore entitled to be discharged. In deciding the question the court said:
“If the question be Improperif the court interrogate a witness about a matter over which it has no jurisdiction and about which it has no right to inquire, the refusal of the witness to answer the interrogatory is no contempt of court, and any order or decision which punishes the refusal to answer as a contempt, is void. * * * To require a witness to submit to answer an illegal and improper question must be regarded as the personal command of the judge, rather than the judicial order of the court.”
The cases all agree that an act of a witness in refusing to answer a question propounded to him, if it be his right to decline to answer, will not become a criminal contempt by being adjudged so. People ex rel. Hackley v. Kelly, 24 N. Y. 75.
The question then is whether the fact sought to be elicited from the appellant by the question propounded to him on cross-examination, and which he refused to answer, was of such privileged character as justified the witness in refusing to answer the same.
The appellant is an attorney at law, and a member of the bar of the supreme court of the District of Columbia. In taking the memoranda for the preparation of the will of the party whose name he refused to disclose, he was certainly acting in his character of attorney, and the relation of client and attorney existed, if his statement be truthful. Was he bound to disclose the name of his client, under the circumstances related by him ? The law upon this subject is well settled, and admits of no question or doubt.
*468Professional communications, made by client to an attorney, or communications passing between client and attorney, are, upon principles of public policy, and from tbe necessity of preserving confidence in all matters of business where the assistance or agency of an attorney is required, held to be privileged from disclosure; and tbis privilege is tbat of tbe client rather than tbat of tbe attorney. Tbis privilege embraces all communications made by tbe client to bis attorney for and in course of tbe business for wbicb tbe attorney may be employed. Tbe latter cannot be permitted to disclose such communications, whether .they be in the form of title deeds, wills, documents, or other papers delivered or statements made to him, or of letters, entries, or statements, written or made by him in that capacity. Herring v. Clobery, 1 Phill. Ch. 91, 96, 11 L. J. Ch. N. S. 149; Cromack v. Heathcote, 2 Brod. & B. 4, 4 J. B. Moore, 357, 22 Revised Rep. 638; Greenough v. Gaskell, 1 Myl. & K. 101, Coop. i. Brougham, 96. Tbe protection is not qualified by any reference to proceedings pending or in contemplation, nor is it material tbat tbe client be in no manner before the court where disclosure is sought to be bad.
“If, touching matters that come within tbe ordinary scope of professional employment, they [legal advisers] receive a communication in their professional capacity, either from a client, or on bis account and for bis benefit in tbe transaction of bis business, or, wbicb amounts to the same thing, if they commit to paper, in tbe course of their employment on bis behalf, matters wbicb they know only through their professional relation to the client, they are not only justified in withholding such matters, but bound to withhold them, and will not be compelled to disclose the information or produce tbe papers in any court of law or equity, either as party or as witness.” 1 Greenl. Ev. 12th ed. §§ 236-244; 1 Taylor, Ev. 6th ed. pp. 812-816; and the cases cited by tbe authors.
It is true, the strict enforcement of tbe rule may, in some eases, operate to tbe exclusion of truth; but tbat does not justify the breaking down of a great principle of protection founded m wisdom and public policy, and necessary to be observed in tbe *469administration of an enlightened system of jurisprudence. Like all other general principles, it may, in some instances, fail to accomplish the ends for which it was established. The privilege of the witness or his client, however, does not preclude the adverse party from resorting to any and all legitimate methods, of proof to reach the facts desired to have disclosed.
In this case, it was competent to show by independent evidence that the witness, claiming and insisting upon his privilege,, had in fact no such client as he pretended to have, and thus, by’ such proof, to impeach the credibility of the witness. But not by compelling' the witness against his claim of privilege to make; the disclosure. For by making the disclosure of the name of his client he would certainly have committed a breach of professional confidence, and violated a privilege of his client, supposing him to have one, as he had stated in his testimony.
It has been held, in some cases, that an attorney may be required to disclose the name of the person by whom he was retained, in order to let in the confessions or admissions of the real party in interest; the character in which his client employed him, whether that of an executor or trustee, or on his private account. But this is not a principle of universal application, and manifestly it has no application to this case. A question somewhat of this nature arose in the case of Chirac v. Reinicker, 11 Wheat 280, 285, 6 L. ed. 474, 475. It was there held that counsel could not disclose whether they were employed to conduct an ejectment suit for their client as landlord of the premises. The real dispute in that case was, whether the question put to counsel did involve the disclosure of professional confidence.' If the question had stopped at the inquiry, says the' court, “whether the witnesses [the counsel] were employed by’ Reinicker as counsel, to conduct the ejectment suit, it would deserve consideration, whether it could be universally affirmed,that it involved any breach of professional confidence. The fact’ is preliminary in its own nature, and establishes only the existence of the relation of client and counsel, and, therefore, might: not necessarily involve the disclosure of any communication arising from that relation after it was created. But the question; *470goes farther. It asks, not only whether the witnesses were employed, but whether they were employed by Eeinicker to conduct the ejectment for him, as landlord of the premises. We are all of opinion that the question in this form does involve a disclosure of confidential communications. It seeks a disclosure of the title and claim set up by Eeinicker to his counsel, for the purpose of conducting the defense of the suit. It cannot be pretended that counsel could be asked what were the communications made by Eeinicker as to the nature, extent, or grounds of his title; and yet, in effect, the question, in the form in which it is put, necessarily involves such a disclosure.”
In this case, the question put to the witness and which he refused to answer, by declining to give the name of the party from whom he took the memoranda for preparing the will, involved a breach of professional confidence, which the witness had expressly pledged himself not to violate, according to his testimony. The fact, however, of his being employed to take the memoranda for preparing the will was fully within the privilege of confidential communications as between client and attorney, lew people who find it necessary to employ an attorney to prepare a will desire the fact to be publicly known. It is essentially a confidential and privileged communication; and few attorneys would be employed to draft wills if it were understood that they were at liberty to disclose the fact to any person, or upon any occasion, when disclosure might be desired. In this case, the name of the person from whom the memoranda were taken was, at most, but a collateral fact; but the disclosure being protected by the privilege of the client, the attorney was not, upon any principle, compellable to disclose the name.' 1 Green! Ev. § 448. By the terms of the commitment, the appellant could not relieve himself from imprisonment except by violating the privilege of his client; and this he could not be compelled to <do.
Upon the case as presented, we are of opinion that the appellant was without lawful or sufficient cause committed to prison, and that his detention is wrongful and without warrant of law. and, consequently, he is entitled to be discharged. It follows, *471therefore, that the order from which the appeal is taken must be reversed, and the appellant be discharged; and it is so ordered.
Order reversed and Ike appellant discharged from further detention.