
340 N.W.2d 265 (1983)
David Lee STOVALL, Appellant,
v.
STATE of Iowa, Appellee.
No. 69331.
Supreme Court of Iowa.
November 23, 1983.
*266 Patrick J. Kelly, Davenport, for appellant.
Thomas J. Miller, Atty. Gen., Roxann M. Ryan, Asst. Atty. Gen., and William E. Davis, County Atty., for appellee.
Considered by REYNOLDSON, C.J., and UHLENHOPP, HARRIS, McCORMICK, and McGIVERIN, JJ.
UHLENHOPP, Justice.
This appeal involves a question of whether a guilty plea was voluntarily and intelligently made.
Applicant David Lee Stovall was previously convicted of a forcible felony, robbery. On the present occasion the prosecutor charged him with a second forcible felony, first-degree robbery with a firearm. The charge of the use of a firearm, if established, would subject Stovall to section 902.7 of the Iowa Code (1981):
At the trial of a person charged with participating in a forcible felony, if the trier of fact finds beyond a reasonable doubt that the person is guilty of a forcible felony and that the person represented that he or she was in the immediate possession and control of a firearm, displayed a firearm in a threatening manner, or was armed with a firearm while participating in the forcible felony the convicted person shall serve a minimum of five years of the sentence imposed by law. A person sentenced pursuant to this section shall not be eligible for parole until he or she has served the minimum sentence of confinement imposed by this section.
Stovall tendered a guilty plea to the charge but refused to admit a factual basis for it. The district court therefore refused to accept the plea.
At trial on the charge the prosecutor and Stovall entered into a plea bargain. The prosecutor would recommend incarceration but would not recommend a factual finding of the use of a firearm so that the five-year mandatory incarceration would not be triggered. Stovall would plead guilty and admit a factual basis. The parties carried out the bargain.
The district court explained to Stovall that the plea bargain obviated the five-year ineligibility for parole, in this exchange:
The Court: I'll now ask the prosecuting attorney and defense counsel, is this plea a result of a prior plea discussion or agreement?
Mr. Ottesen [prosecutor]: It is, Your Honor. Our agreement is that we will recommend incarceration for a term of twenty-five years, but will not recommend the imposition of the minimum sentence.
The Court: Do you understand that?
Defendant: Yes.
The Court: That means there won't be any five-year period that you have to serve before you're eligible for parole; do you understand that?

Defendant: Yes.

....
The Court: And this plea is a result of a plea agreement, which you are now presenting to the court. I'm going to read it to you, Mr. Stovall: "Defendant to plead guilty to Robbery in the First Degree. State recommends twenty-five year term. State does not recommend a minimum sentence." In other words, they don't recommend that you serve five years before you're eligible for parole. Do you understand?


*267 Defendant: Uh-huh.

(Emphasis added.)
The court accepted the plea bargain and Stovall's plea, and imposed sentence for no more than twenty-five years, pursuant to statute. Iowa Code § 902.9 (1981).
The second paragraph of section 906.5 of the Code provides regarding paroles:
If the person who is under consideration for parole is serving a sentence for conviction of a felony and has a criminal record of one or more prior convictions for a forcible felony or a crime of a similar gravity in this or any other state, parole shall be denied unless the defendant has served at least one-half of the maximum term of his or her sentence.

(Emphasis added.) Actually the times in both section 902.7 and section 906.5 can be shortened by good and honor time. See Iowa Code §§ 246.38 and .43. For convenience we use the figures five years and twelve and one-half years respectively.
After Stovall had been in prison for about a month a prison official informed him he would not immediately be eligible for consideration for parole. Stovall wrote his attorney to find out whether he should be ineligible. Eventually he discovered from the parole board that he would be ineligible until the lapse of half of the period of his sentence. He thereafter commenced this postconviction proceeding challenging the validity of his plea on the basis of the facts we have recited.
After hearing, the postconviction court denied relief. Stovall appealed.
The record demonstrates beyond doubt that all participants in the guilty-plea proceeding thought the impediment to consideration for parole was the five-year ineligibility under section 902.7, whereas in truth the additional problem was the longer ineligibility period under section 906.5. We need not pause to inquire how that misapprehension came about; the fact is, it existed.
The record is also clear that Stovall would not admit a factual basis for a guilty plea if he was to be ineligible for parole for five yearslet alone twelve and one-half years. He thought the plea agreement eliminated that impediment. The district court's assurance to Stovall buttressed Stovall's misapprehension: "That means there won't be any five-year period you have to serve before you're eligible for parole...."
The State argues that the court's words were literally true: Stovall would not have to wait five years, because a finding of the use of a firearm would not be made. But the court's statement that Stovall would not have to wait five years conveyed the impression that Stovall was immediately eligible for consideration for parole, not that he had to wait longer than five years for consideration.
The State also argues that when the court inadvertently made the quoted statements, Stovall's attorney should have corrected the misunderstanding and advised Stovall that he would have to serve a minimum of half of twenty-five years. We think, however, that a defendant is entitled to rely on statements made by a court, whether those statements are or are not required of the court under rule 8 of the rules of criminal procedure. If the court does make a misstatement, if the misstatement is material in the sense that it is part of the inducement for the defendant's decision to plead guilty, if the defendant's attorney does not correct the misstatement, and if the defendant enters a guilty plea accordingly, the plea is not intelligently and voluntarily made, and the defendant is entitled to have his plea set aside and to plead anew. That is substantially the situation which we have here. See Meier v. State, 337 N.W.2d 204 (Iowa 1983); State v. Boone, 298 N.W.2d 335 (Iowa 1980).
We direct the district court to set aside the guilty plea, sentence, and judgment in the criminal case, and to permit Stovall to plead anew.
REVERSED.
