
49 Wn.2d 318 (1956)
301 P.2d 161
In the Matter of the Application for a Writ of Habeas Corpus of ROY EDVIR NAHL, Petitioner,
v.
LAWRENCE DELMORE, JR., as Superintendent of the State Penitentiary, Respondent.[1]
No. 33554.
The Supreme Court of Washington, Department Two.
September 13, 1956.
Simmons, Simmons & Yates, for petitioner.
The Attorney General and Michael Alfieri, Assistant, for respondent.
WEAVER, J.
This is a petition for a writ of habeas corpus filed by Roy Edvir Nahl.
July 16, 1952, petitioner was charged in King county with first degree burglary and second degree assault. Before trial of these charges, a hearing was instituted to determine his mental condition. During the progress of this trial before a jury, petitioner pleaded guilty to second degree assault. The hearing to determine his mental condition was discontinued and the charge of burglary was dismissed. October 28, 1952, judgment and sentence were filed, and the warrant of his commitment to the penitentiary was issued.
January 6, 1953, petitioner filed his first petition for a writ of habeas corpus. An amended petition was filed November 3, 1953. At the hearing in this court on January 15, 1954, it appeared that petitioner was in Eastern State Hospital at Medical Lake, Washington. January 22, 1954, an order was entered which, among other things, stated:
"The members of the court are further of the opinion that justice requires this proceeding be sent to the Superior Court of Washington for Spokane County for a hearing and determination of the mental status of petitioner, and it is so ordered:
"It is further ordered that in the event it should be determined by the Superior Court that petitioner is sane and not a subject for mental treatment, he be remanded to the custody of the respondent [superintendent of Washington State Penitentiary]; and
"It is further ordered that in the event of remand of petitioner to the custody of respondent, it shall be without prejudice to petitioner to have determined by this court whether *320 he shall be permitted to withdraw his plea of guilty and stand trial on one or both of the charges heretofore made against him."
Pursuant to this order, the superior court of Spokane county held its hearing at Eastern State Hospital. Dr. Robert H. Southcombe, superintendent of the hospital, testified that petitioner had been transferred to the hospital April 22, 1953,
"... by order emanating from the Department of Public Institutions in Olympia ..."
The trial court, having found petitioner to be a paranoid schizophrenic, entered conclusions of law
"I. That the petitioner is mentally irresponsible, is not a safe person to be at large and is not capable of conducting any legal proceedings in his own behalf.
"II. That the petitioner, as a result of his condition, should remain in the care, custody and control of the authorities of the Eastern State Hospital for the insane at Medical Lake, Washington."
The order of this court of January 22, 1954, is silent as to petitioner's rights in the event the superior court of Spokane county found him to be insane. November 4, 1955, the present petition for writ of habeas corpus was filed. The crux of the petition is that his plea of guilty was not voluntary; that it was equivocal; that it was the result of coercion arising from the circumstances surrounding it; and that his constitutional rights were thus violated.
Respondent Lawrence Delmore, Jr., superintendent of the Washington State Penitentiary, has moved to dismiss the petition. He advances four reasons in support of his motion: (1) that Edna C. Nahl, who verified the petition, makes no showing that she is legal guardian of the petitioner and is without legal capacity and authority to prosecute the petition; (2) that petitioner does not have the mental capacity to prosecute his petition; (3) that the petitioner is an inmate at the Eastern State Hospital at Medical Lake, Washington; and (4) that petitioner is not in the custody of respondent.
[1] Respondent's motion to quash the petition amounts to a demurrer. We so consider it. We assume the truth of *321 those facts which are well pleaded for the purpose of testing the sufficiency of the petition.
[2] Respondent's first contention  that Edna C. Nahl, who verified the petition, is without legal capacity and authority to prosecute the petition  is without merit. Her verification, as the "natural mother of the Petitioner," states:
"... that she has the authority and right to verify said petition for and on behalf of the above named Petitioner, by nature, law and permission."
Her right to prosecute the petition is authorized by statute.
RCW 7.36.030 provides:
"Application for the writ [of habeas corpus] shall be made by petition, signed and verified either by the plaintiff or by some person in his behalf, ..." (Italics ours.)
[3] If a person claims to be restrained of his liberty by judicial process, which he alleges violated his constitutional rights, his subsequent mental illness does not foreclose the right of "some person in his behalf" testing the validity of his confinement in the penitentiary by petition for a writ of habeas corpus.
RCW 7.36.020 provides:
"Writs of habeas corpus shall be granted in favor of parents and guardians, [masters and husbands, and] to enforce the rights and for the protection of infants and insane persons; ..." (Bracketed words appear and italicized words do not appear in the original statute. See Laws of 1854, § 456, p. 214; Code of 1881, § 688.)
Hence, the petition before us, which attacks the King county judgment and sentence of October 28, 1952 (as distinguished from his confinement in the Eastern State Hospital), is not subject to respondent's motion to strike upon the ground that petitioner does not have the mental capacity to prosecute it.
[4] It appears to be a rule of general application that the person who has custody of a prisoner, and who is exercising *322 actual restraint of his person, and who has the power to produce him physically, is the one to whom the writ of habeas corpus should be directed. See Durham v. Callahan, 42 Wn. (2d) 352, 356, 255 P. (2d) 374 (1953); In re Wyback v. Board of Prison Terms & Paroles, 32 Wn. (2d) 780, 203 P. (2d) 1083 (1949); Jones v. Biddle, 131 F. (2d) 853, 854 (C.C.A. 8th, 1942), cert. den. 318 U.S. 784, 87 L.Ed. 1152, 63 S.Ct. 856; United States ex rel. Goodman v. Roberts, 152 F. (2d) 841 (C.C.A. 2d, 1946); 25 Am. Jur. 158; 39 C.J.S. 622.
The record discloses that petitioner is in the actual custody of the superintendent of Eastern State Hospital, by order of the department of public institutions, and not in the custody of respondent. The statute, by virtue of which petitioner was transferred from the penitentiary to the hospital, provides:
"... The superintendent of the hospital for insane shall receive such convict, and keep him until cured. ..." RCW 72.08.110. (Italics ours.)
Under the statute, respondent's only interest in actual custody will arise upon petitioner's cure or discharge from the hospital, prior to the expiration of his sentence.
Since the superintendent of the hospital is not a party, it is apparent that nothing which may transpire under the present petition for a writ of habeas corpus can affect petitioner's status as an inmate of Eastern State Hospital. We express no opinion on the question of whether a petition for a writ of habeas corpus is or is not the proper procedure to test the validity of petitioner's detention there.
Does petitioner's custody by the superintendent of the hospital foreclose him from testing the validity of the King county judgment and sentence of October 28, 1952, by writ of habeas corpus? We think not.
Our disposition of the petition for writ of habeas corpus is governed by the rationale of our decision in In re Palmer v. Cranor, 45 Wn. (2d) 278, 273 P. (2d) 985 (1954). Therein, we interpreted and applied RCW 7.36.130 (1) (which is the *323 present codification of Rem. Rev. Stat., § 1075, as amended by Laws of 1947, chapter 256, § 3, p. 1070) which provides:
"No court or judge shall inquire into the legality of any judgment or process whereby the party is in custody, or discharge him when the term of commitment has not expired, in either of the cases following:
"(1) Upon any process issued on any final judgment of a court of competent jurisdiction except where it is alleged in the petition that rights guaranteed the petitioner by the Constitution of the State of Washington or of the United States have been violated."
We have italicized the exception added by the 1947 amendment to the statute.
Of the 1947 amendment, we said:
"It has added to the bare legal review, that seems to have been the limit of judicial authority under the common law and under our statute prior to 1947, a more searching investigation, limited to a consideration of alleged invasion of constitutional rights."
[5, 6] The factual situation of the Palmer case, supra, is not unlike the one now before us. Palmer was incarcerated in the penitentiary, under a lawful judgment and sentence, at the time he attacked the validity of a subsequent judgment and sentence by writ of habeas corpus. It was argued that the petition could not be entertained until he had completed his first sentence. In the instant case, petitioner is presently detained in the Eastern State Hospital. Solely for the purpose of this opinion, we assume his detention to be valid.
In the Palmer case, supra, we said:
"The logic of respondent's argument is unassailable if the sole purpose of a writ of habeas corpus is to seek release from confinement. No matter what the rule is elsewhere, the fact remains that we have on numerous occasions denied release of petitioner under the writ, and in addition, either (1) set aside the judgment and sentence and directed that petitioner again be rearraigned [citing cases] or (2) remanded petitioner to the superior court for resentencing. [Citing cases.]
"...
"Those portions of the petition for a writ of habeas corpus *324 which we can consider, and the supporting documents, raise a question of fact  was petitioner's plea of guilty the result of coercion? To hold that a court of competent jurisdiction cannot examine this question until the expiration of his first sentence [or the release of petitioner in the instant case from the hospital], would not only vitiate the statutes, but it would deny petitioner procedural due process to require him to wait until the expiration of the first sentence. Witnesses move away; evidence disappears; memories grow dim."
Since the petition raised factual questions which could not be resolved without a hearing, we referred it to the superior court to determine the facts relative to coercion, which were alleged to have resulted in petitioner's plea of guilty.
Respondent's motion to dismiss the petition for writ of habeas corpus is denied; he shall have thirty days, from the date this opinion becomes final, in which to file his return and answer to the petition. Petitioner shall have thirty days, from date of service of respondent's return and answer, in which to controvert it if he so elects.
We refer the petition for writ of habeas corpus, and such pleadings as may be filed, to the superior court of King county for a hearing to determine the issues of fact raised which may be considered in a habeas corpus proceeding, and for disposition thereof according to law.
In view of petitioner's detention in the hospital at Medical Lake, under circumstances which seem to indicate that he is not a "safe person to be at large," the superior court may determine whether petitioner is too violent to be brought into court.
Upon the lapse of time for filing pleadings, as herein provided, the clerk of this court shall transmit the petition, and such pleadings as have been filed, to the clerk of the superior court of King county.
It is so ordered.
MALLERY, HILL, and ROSELLINI, JJ., concur.
NOTES
[1]  Reported in 301 P. (2d) 161.
