
432 S.W.2d 656 (1968)
Walter William USSERY, Appellant,
v.
Harry S. AVERY and C. Murray Henderson, Wardens, Tennessee State Penitentiary, Nashville, Tennessee, Appellees.
Supreme Court of Tennessee.
October 11, 1968.
Frank J. Runyon, Clarksville, for appellant.
George F. McCanless, Atty. Gen., and Robert H. Roberts, Asst. Atty. Gen., Nashville, and Noel R. Bagwell, Clarksville, prosecuted the case for the State in the trial court.

OPINION
HUMPHREYS, Justice.
On August 26, 1965, Walter William Ussery pleaded guilty to an indictment in case No. 11407, charging him with armed *657 robbery, and was sentenced to serve ten years in the penitentiary. The same day, he pleaded guilty to an indictment in case No. 11406, charging him with a second offense of armed robbery, and was sentenced to serve ten years in the state penitentiary; the sentence in the last case to be served consecutive to the sentence in No. 11407. After transfer to the state penitentiary, on November 21, 1966, Ussery filed a petition for writ of habeas corpus in the Circuit Court of Davidson County, Tennessee, which was transferred to the Criminal Court of Montgomery County for trial. He contended the conviction in case No. 11407 is void for a number of reasons. However, he made no attack on his conviction in case No. 11406.
Harry S. Avery, Commissioner of Corrections, and C. Murray Henderson, Warden, Tennessee State Penitentiary, made a return to the writ issued pursuant to the petition, admitting petitioner was in custody in the State Penitentiary at Nashville, Tennessee, and defending on the ground, among others, that the petition was premature, because the time during which Ussery might legally be detained under the judgment in No. 11406 had not expired.
At the trial, the only issue on which the court heard evidence was the prematurity of the suit. Over petitioner's objection, respondents' authority to detain Ussery was sought to be proved by introduction of the minutes of the Criminal Court of Montgomery County, showing the two judgments of conviction in Nos. 11407 and 11406. This evidence was objected to by Ussery's counsel on the ground it was not competent to show the authority on which Ussery was then being detained at the state penitentiary.
The additional contention was made that, inasmuch as the judgment in No. 11406 expressly ran consecutive to the judgment in No. 11407, petitioner was entitled to have the validity of the judgment in 11407 determined.
Both contentions were denied by the trial judge, and the petition was dismissed as premature. On appeal, the State Court of Criminal Appeals affirmed. Certiorari has been granted, so we can review this holding.
The same two contentions are made here, (1) that the court should not have allowed proof of authority to detain by reference to the court minutes; (2) that the judgment in case No. 11406 does not prevent consideration of the validity of the judgment in case No. 11407. We think the first of these contentions is good, but that the latter is not.
Although the writ of habeas corpus is a high, prerogative common law writ, Bateman v. Smith, 183 Tenn. 541, 194 S.W.2d 336, thought by some to have been used before Magna Charta, People v. Liscomb, 60 N.Y. 559, 19 Am.Rep. 211, and guaranteed as a right by the Constitution of Tennessee, Article I, § 15, the practice in regard thereto has been regulated by statute in this state at least since the Code of 1858. As to statutes of this kind, it has generally been held that they are not intended to detract from the force of the writ, but rather to add to its efficiency. People v. Mercein, 3 Hill (N.Y.) 399, 38 Am.Dec. 644; People v. Liscomb, supra. In Bateman it was held that since habeas corpus is an extraordinary procedure, the mandatory provisions of the statute relating thereto must be complied with by a petitioner. This applies, a fortiori, to one who detains another.
In considering the assignment of error as to proof of lawful detention, we find that T.C.A. § 23-1823, which applies to this very matter, was not complied with. This Code section provides that when a party, such as Warden Henderson, is served with a writ of habeas corpus, he "shall state in his return, plainly and unequivocally: (1) Whether he then has, or at any time has had, the party in his control or restraint, and, if so, the authority and cause thereof, setting out the same fully. (2) If the party is detained under a writ, warrant, or other written authority, a copy thereof shall be annexed to the return, and the original shall *658 be produced and exhibited to the court or judge, if required."
Although respondents' answer states petitioner is in custody in the State Penitentiary at Nashville, pursuant to judgments convicting him of armed robbery in cases Nos. 11407 and 11406, no copy of the written authority under which respondents were holding petitioner was annexed to the return, nor was such authority produced and exhibited at the trial.
It is not enough, since it is not a compliance with the statute, to prove by the clerk that there is a judgment of conviction on the minutes of the court which, by reason of its duration, could account for the keeping of the prisoner in custody. Proof of authority to detain must be made in accordance with the statute, which recognizes that events may have made the judgment ineffective.
While it may plausibly be argued that resort should be had to the presumption of regularity which appertains to official conduct to sustain the right to detain upon proof of minutes showing a judgment and sentence, this cannot be done in view of the express and mandatory provisions of the statute. And, while it would be possible to rationalize around the statute provision, we ought not, and will not do this. Especially, since we have already held that the provisions of T.C.A. § 23-1807 with respect to the contents of a petition for the writ are mandatory. In the light of this ruling, which could hinder resort to the writ, we should, just as strongly stand for a mandatory construction of T.C.A. § 23-1823. But such consideration aside, it is so easy to comply with the statute, and so dangerous not to (for who else but the keeper knows the state of his records and authority to keep), that we must hold for strict compliance.
Accordingly, we sustain this assignment.
Turning to the next assignment, which we consider in order to advise the trial court as to our views, we are of opinion it is not good. Assuming the warden has written authority which he can exhibit to his answer on remand, or can prove by the prison records, the right to detain, still, the petitioner would not be entitled to a judgment on his petition, as it would be premature.
Here again, the issue is resolved by a plain provision of the Habeas Corpus Act. T.C.A. § 23-1831 provides that the party detained shall be remanded to custody, when it appears "the time during which he may be legally detained has not expired:". No provision is made for passing on the validity of a judgment other than to release or detain.
Since, if the conviction were to be void in case No. 11407, petitioner's detention under the conviction in No. 11406 is valid, and a basis for petitioner's legal detention, under the plain requirement of this Code section (T.C.A. § 23-1831), it would be the duty of the court to remand petitioner to the custody of the warden.
In view of this plain statute provision, nothing can be accomplished by reference to holdings in other jurisdictions. The courts of this state have nothing to do but follow the statute.
This is not to say, however, that petitioner cannot have the benefit of a void judgment in case No. 11406, if it is void. For, it is the considered opinion of the Court that at such time as a petitioner would be entitled to discharge by reason of his having served time equivalent to the judgment or judgments he does not attack, he would be entitled to petition for the writ of habeas corpus to inquire into the validity of his further restraint. That, if the first sentence is void, the time served will be applied to the good sentence, and at the end of that sentence, with good time considered, release can be sought by habeas corpus.
This may seem a roundabout course but it is required by our statute, and does the prisoner no injustice; only delaying the *659 filing of a petition to the time when it could gain his release.
This holding is not contrary to Walker v. Wainwright, 390 U.S. 335, 88 S.Ct. 962, 19 L.Ed.2d 1215 (1968) as in that case the state court would require the prisoner to serve the void judgment because it was followed by a sentence to run consecutively to it. We do not do this. We recognize this as being unreasonable on its face. But we do not think it is unreasonable to require a prisoner to serve the time he concedes is valid before applying for the writ. But, reasonable or not, it is required by our statute, which, in our opinion, is not unconstitutional. Nor is Peyton v. Rowe, 391 U.S. 54, 88 S.Ct. 1549, 20 L.Ed.2d 426, opinion May 20, 1968, applicable. That case is based on the Federal Habeas Corpus Act, 28 U.S.C. 2241(c) (3), and involves no constitutional right this Court is required to recognize.
The case is remanded to the Criminal Court of Montgomery County, where respondents will be permitted to amend their return so as to comply with the statute. Thereafter, the case may be proceeded with under the law as stated in this opinion.
BURNETT, C.J., and DYER, CHATTIN and CRESON, JJ., concur.
