
1 Ariz. App. 593 (1965)
405 P.2d 903
Royal LEONARD, Appellant,
v.
Frank A. EYMAN, Warden, Arizona State Prison, the State of Arizona, et al., Appellees.
No. 2 CA-CR 27.
Court of Appeals of Arizona.
September 30, 1965.
Royal Leonard, in pro. per.
Darrell F. Smith, Atty. Gen., James S. Tegart, Asst. Atty. Gen., Phoenix, for appellees.
KRUCKER, Chief Judge.
Appellant, Royal Leonard, pleaded guilty in the Superior Court of Maricopa County, Arizona, on November 7, 1962, to the charge of aggravated battery and imposition of sentence was suspended for a period of one year. Defendant violated the terms of his probation and on May 22, 1963, the court revoked appellant's probation in Case No. 40855, and sentenced him to imprisonment in the Arizona State Prison for a term of not less than four years nor more than five years.
In the meantime, on March 2, 1963, appellant shot and killed his mother-in-law, wounded his sister-in-law and shot at his father-in-law several times, missing him. Complaint was filed charging appellant in *594 one count of murder and three counts of assault with a deadly weapon.
Trial was held in the Superior Court of Maricopa County and on November 16, 1963, the jury returned verdicts on all four counts of not guilty by reason of insanity. An order of release was issued by the court.
A petition for the examination of appellant as a mentally ill person under the provisions of A.R.S. § 36-502 was filed and after the hearing the appellant was committed to the Arizona State Hospital. The trial court had previously ordered that the appellant, if committed, be returned to the Arizona State Prison for carrying out the provisions of the previous sentence upon his discharge from the Arizona State Hospital.
On October 1, 1964, appellant was given a complete discharge from the Arizona State Hospital and was transferred to the Arizona State Prison to serve the sentence imposed by the revocation of probation in Case No. 40855.
On March 25, 1965, appellant filed an application in the Superior Court of Pinal County for writ of habeas corpus. Appellant was given an opportunity to be heard but elected to stand on the pleadings. On April 30, 1965, the court entered an order denying the application for a writ of habeas corpus and from that order this appeal is taken.
The only grounds for appeal set forth in the appellant's opening brief is the failure to appoint counsel to prosecute this appeal.
There is no question that a defendant in a criminal prosecution or one charged with a crime is entitled to counsel. Our Supreme Court has extended the rule to include serious misdemeanors. See State v. Anderson, 96 Ariz. 123, 392 P.2d 784 (1964).
We hold that an applicant for a writ of habeas corpus is not entitled to counsel either in the application for the writ or on appeal from the adverse decision thereon.
A proceeding on a writ of habeas corpus is not a criminal prosecution. It is merely a civil proceeding to test the legality of and the correctness of detention and to determine if detention and restraint or imprisonment is illegal. A.R.S. § 13-2001.
There is no right to appointment of counsel in a civil proceeding in the State of Arizona.
There is no showing that the sentence being served by the appellant is in any respect illegal or unlawful and the judgment of the lower court denying the applicant's petition for a writ of habeas corpus is affirmed.
HATHAWAY and MOLLOY, JJ., concur.
