
443 P.2d 988 (1968)
Francis D. OSBORNE, Plaintiff in Error,
v.
Guy F. VAN CLEAVE, Defendant in Error.
No. 23054.
Supreme Court of Colorado, En Banc.
July 29, 1968.
*989 Michael F. Morrissey, Denver, for plaintiff in error.
Duke W. Dunbar, Atty. Gen., Frank E. Hickey, Deputy Atty. Gen., George E. DeRoos, Asst. Atty. Gen., Denver, for defendant in error.
PRINGLE, Justice.
This writ of error is directed to a judgment of the District Court of Adams County ordering the sheriff of said county to turn over plaintiff in error (hereinafter called Osborne) to the proper authorities of the State of Nebraska under an extradition warrant issued by the Governor.
The Attorney General has confessed error, stating that, in his opinion, the procedures followed in the lower court failed to conform to statutory requirements. We agree.
C.R.S.1963, 60-1-10, directs that a person arrested under an extradition warrant be taken forthwith before a judge of a court of record, who shall inform him of the charges against him and of his right to counsel. It further provides:
"* * * If the prisoner or his counsel shall state that he or they desire to test the legality of his arrest, the judge of such court of record shall fix a reasonable time to be allowed him within which to apply for a writ of habeas corpus. When such writ is applied for, notice thereof, and of the time and place of hearing thereon, shall be given to the prosecuting officer of the county in which the arrest is made and in which the accused is in custody, and to the agent of the demanding state."
It is evident from the wording of the provision above quoted that the statute contemplates a hearing on the legality of the prisoner's detention, if he requests one, and that such a hearing can be had only when a writ of habeas corpus has been duly applied for by the prisoner and issued by the court. Capra v. Miller, 161 Colo. 448, 422 P.2d 636; Krutka v. Bryer, 150 Colo. 293, 372 P.2d 83.
In the instant case, although Osborne had applied for a writ of habeas corpus, no such writ was in fact ever issued by the trial court. As a result, although defendant in error, as sheriff of Adams County, was served with a summons and a copy of the "Petition for Writ of Habeas Corpus," no Writ of Habeas Corpus was ever served on the sheriff, nor was any process of any kind issued to the agent of the demanding state.
C.R.S.1963, 65-1-1, provides that when application is made to a court for a writ of habeas corpus, that court "shall forthwith award" the writ, unless the application is invalid on its face, and that such writ "shall be directed to the person in whose custody the prisoner is detained, and made returnable forthwith." The petition here was in proper form and asserted facts which, if proved, would constitute valid legal grounds for Osborne's release. The court should have issued the writ, and after return was made by the parties required to be served by C.R.S.1963, 60-1-10, a hearing should have been held on Osborne's claim that his arrest was invalid. See McNamara v. People, 159 Colo. 139, 410 P.2d 517; Struble v. Hicks, 123 Colo. 16, 224 P.2d 932.
The judgment is reversed and the cause remanded for further proceedings in accordance with the statutory provisions cited herein.
DAY and KELLEY, JJ., not participating.
