This appeal is from a summary dismissal of a petition for a writ of habeas corpus seeking to quash a Texas detainer warrant filed with the Arizona State Prison.
The undisputed facts giving rise to this appeal are set forth in appellant’s petition and the State’s response. Briefly, they are as follows. On May 13, 1969, appellant was in the custody of the sheriff of Guadalupe County, Seguin, Texas, occasioned by an alleged traffic violation. Upon his conviction and sentence to a jail term, Texas initiated parole revocation proceedings. On June 5, 1969, pursuant to an extradition request by Arizona, a Governor’s Warrant issued out of the office of the Governor of the State of Texas. In compliance with this warrant, the sheriff of Seguin delivered appellant to the custody of the Maricopa County sheriff on June 19, 1969. On July 21, 1969, Texas authorities lodged a detainer warrant with the sheriff of Maricopa County for the alleged parole violation. Subsequently, appellant was convicted of attempted robbery, receiving a sentence of not less than twelve nor more than fifteen years. See, State v. Howard, 106 Ariz. 403, 476 P.2d 858 (1970).
Because appellant was imprisoned in the Arizona State Prison by reason of this sentence, the Texas Department of Corrections on February 24, 1970, filed a detainer with the Superintendent of Prisons.
The gravamen of appellant’s complaint that the petition should not be dismissed without a hearing is that the detainer warrant issued by the Texas authorities is unlawful because Texas relinquished custody and jurisdiction over appellant to Arizona. Appellant overlooks the fact, however, that the detainer under attack here was not the cause of the imprisonment or restraint. He is imprisoned by reason of his Maricopa County sentence. See, Atkins v. State ex rel. Eyman, 15 Ariz.App. 364, 488 P.2d 1001 (1971).
The function of a habeas corpus proceeding under A.R.S. § 13-2001 et seq. is to obtain the release of one unlawfully detained. State v. Abbott, 103 Ariz. 336, 442 P.2d 80 (1968) ; Leonard v. Eyman, 1 Ariz.App. 593, 405 P.2d 903 (1965). When it is apparent from the face of the petition that a petitioner is not entitled to relief, the trial court is correct in denying the petitioner a hearing. Witt v. State ex rel. Eyman, 18 Ariz.App. 120, 500 P.2d 905 (1972) ; Landers v. State ex rel. Eyman, 7 Ariz.App. 197, 437 P.2d 681 (1969). Such is the case here.
Judgment affirmed.
HATHAWAY and HOWARD, JJ., concur.