
653 P.2d 813 (1982)
103 Idaho 758
Melton Waters GIBBS, Plaintiff-Appellant,
v.
STATE of Idaho, Defendant-Respondent.
No. 13910.
Court of Appeals of Idaho.
November 3, 1982.
*814 Stephen J. Blaser, Blackfoot, for plaintiff-appellant.
David H. Leroy, Atty. Gen., Lynn E. Thomas, Sol. Gen., Timothy M. Walton, Deputy Atty. Gen., Boise, for defendant-respondent.
SWANSTROM, Judge.
Melton Gibbs is serving a lengthy sentence in the state of Texas following his conviction there of the crime of rape. He contends that this sentence was enhanced under Texas law because he had a previous conviction of rape in Bingham County, Idaho, more than thirty years ago. Hoping to get his Texas sentence reduced, Gibbs has filed an application for a writ of habeas corpus in Bingham County. He seeks to set aside his former conviction on the ground that it was based upon a guilty plea entered without a knowing and intelligent waiver of rights.
In the district court Gibbs' application was treated as one for post-conviction relief under the Idaho Uniform Post-Conviction Procedure Act. The state moved to dismiss the application on the sole ground that it was not timely filed under I.C. § 19-4902.[1] The district court granted the motion to dismiss. However, the court based its decision not on the question of timeliness, but on the merits of Gibbs' application.
In this appeal Gibbs contends that the court erred by not giving him "an opportunity to reply within 20 days of the proposed dismissal" as required by I.C. § 19-4906.[2] We agree.
In several recent cases, the Idaho Supreme Court has discussed the notice requirement of I.C. § 19-4906(b). In Balla v. State, 98 Idaho 344, 563 P.2d 402 (1977), the district court summarily dismissed an application for post-conviction relief. The sole issue on appeal was whether the court erred in failing to give notice of its intention to dismiss as required by I.C. § 19-4906(b). Reasoning that the notice requirement is couched in the permissive term "may," the Supreme Court approved the summary dismissal. The Supreme Court also noted that I.C. § 19-4906(c) provided additional authority for the summary dismissal.
In Cherniwchan v. State, 99 Idaho 128, 578 P.2d 244 (1978), the Supreme Court, without mentioning Balla by name, apparently overruled it. As in Balla, the district court had determined the application to be meritless and summarily dismissed it. On appeal the Supreme Court observed that although the district court could not be faulted for finding the application meritless, the district court erred in failing to notify petitioner of its intention to dismiss and thus allow him an opportunity to reply within twenty days.
Finally, in Christensen v. State, 102 Idaho 487, 632 P.2d 676 (1981), the Supreme Court *815 again upheld a district court's summary dismissal of a post-conviction relief application, even though it had not given twenty days notice pursuant to I.C. § 19-4906(b). The Supreme Court stated:
I.C. § 19-4906(b) ... governs only those situations where the trial court on its own initiative determines to dismiss the petition, as in Cherniwchan. I.C. § 19-4906(c) covers those situations where either party moves for summary dismissal. [Emphasis added.]
102 Idaho at 488, 632 P.2d at 677. The Supreme Court concluded that because the state had moved for summary disposition, the district court was not required to give twenty days notice of its intent to dismiss. The court reasoned that the purpose of the twenty days notice requirement is to give a petitioner a chance to present evidence and legal authority to the district court to support his position. The court noted, however, that when the state files a motion for summary dismissal, the petitioner is put on notice of the possibility of dismissal and thus is given an opportunity to respond.
Under Christensen, it is proper for a district court summarily to dismiss an application for post-conviction relief without giving notice, if the district court does so upon motion of the state. Although at first glance Gibbs' case appears to have been dismissed properly under Christensen, it is distinguishable. In this case, although the state moved to dismiss, the district court dismissed the case not on the grounds presented by the state, but on different grounds. The district court, upon its own initiative, decided to dismiss the case upon its merits. Unlike the petitioner in Christensen, Gibbs had no opportunity to convince the district court that he should prevail upon the merits. In this case, unlike Christensen, it would not have been redundant for the district court to have given the petitioner twenty days notice of its intent to dismiss as required by I.C. § 19-4906(b). For Gibbs to have had a chance to argue the point which determined the outcome of his case, it was necessary for the district court to comply with the notice requirement. The obvious purpose of the notice requirement of I.C. § 19-4906(b) is to ensure that a petitioner will have the opportunity to challenge an adverse decision before it becomes final. Gibbs did not have that chance in this case. Therefore, the district court's order of dismissal is vacated, and the case is remanded.
The state contends that the order of dismissal should be upheld on appeal because the district court could have decided that Gibbs' petition was untimely filed, rather than dismissing it on the merits. However, we believe the issue of timeliness, which may be a mixed issue of law and fact, should be addressed first  if it need be addressed at all  by the district court. On remand the district judge may decide that issue, or he may give notice to Gibbs under I.C. § 19-4906(b) of his intention to dismiss the application on the merits, for reasons set forth in the order from which this appeal was taken.
WALTERS, C.J., and BURNETT, J., concur.
NOTES
[1]  The pertinent part of I.C. § 19-4902, in effect when Gibbs filed his petition, is as follows:

A proceeding is commenced by filing an application verified by the applicant with the clerk of the district court in which the conviction took place. An application may be filed at any time within five (5) years from the expiration of the time for appeal or from the determination of an appeal or from the determination of a proceeding following an appeal, whichever is later.
[2]  Idaho Code § 19-4906, which permits district courts to rule summarily on applications for post-conviction relief, contains two subdivisions pertinent to this case:

(b) When a court is satisfied, on the basis of the application, the answer or motion, and the record, that the applicant is not entitled to post-conviction relief and no purpose would be served by any further proceedings, it may indicate to the parties its intention to dismiss the application and its reasons for doing so. The applicant shall be given an opportunity to reply within 20 days to the proposed dismissal. In light of the reply, or on default thereof, the court may order the application dismissed or grant leave to file an amended application or, direct that the proceedings otherwise continue. Disposition on the pleadings and record is not proper if there exists a material issue of fact.
(c) The court may grant a motion by either party for summary disposition of the application when it appears from the pleadings, depositions, answers to interrogatories, and admissions and agreements of fact, together with any affidavits submitted, that there is no genuine issue of material fact and the moving party is entitled to judgment as a matter of law.
