
    STATE of Iowa, Appellee, v. David J. MESSER, Appellant.
    No. 64183.
    Supreme Court of Iowa.
    June 17, 1981.
    
      Mary Lou Borst of McAllister Law Office, Mount Pleasant, for appellant.
    Thomas J. Miller, Atty. Gen., Jeanine Freeman, Asst. Atty. Gen., and Michael A. Riepe, Henry County Atty., for appellee.
    Considered by REYNOLDSON, C. J., and UHLENHOPP, HARRIS, ALLBEE, and LARSON, JJ.
   REYNOLDSON, Chief Justice.

Defendant appeals from judgment entered on his guilty plea to a second-degree burglary charge. Defendant asserted before the Court of Appeals, as he does here, that trial court erroneously considered un-prosecuted burglary charges against him in imposing sentence, and that his guilty plea was entered into without full knowledge of the consequences and therefore was invalid. The Court of Appeals, dividing three to two, upheld defendant’s conviction and sentence. After granting defendant’s application for further review, we now hold that decision should be vacated and the case returned to district court for resentencing.

April 12, 1979, defendant was charged by trial information with burglary in the second degree, in violation of sections 713.1 and 713.3, The Code. Defendant agreed to plead guilty, as part of a plea bargain in which the county attorney agreed “the prosecution of certain other offenses [was] to be dropped.” These other alleged offenses included “several other burglaries.”

September 17,' 1979, a sentencing hearing was held. Defendant sought probation, but the county attorney requested that defendant be incarcerated, pointing out defendant’s involvement in two other burglaries the State had not prosecuted. Trial court sentenced defendant to imprisonment for a term not to exceed ten years, stating it was “taking into consideration the fact that there were two other charges that were not prosecuted in this matter as part of a plea bargaining.”

I. Although imposition of sentences is within trial court’s discretionary power and will be set aside only for an abuse of discretion, see State v. Gibb, 303 N.W.2d 673, 687 (Iowa 1981), that discretion is not unlimited. In State v. Thompson, 275 N.W.2d 370 (Iowa 1979), the defendant originally was charged with second-degree burglary, but in accordance with a plea bargain the charge was reduced to third-degree theft. In imposing a sentence of imprisonment, trial court considered the fact a higher crime originally had been charged. Id. at 371. Remanding the case for resen-tencing, we stated:

A sentencing court may not .. . impose a severe sentence for a lower crime on the ground that the accused actually committed a higher crime unless the facts before the court show the accused committed the higher crime or the defendant admits it— even if the prosecutor originally charged the higher crime and reduced the charge .... [T]he accused does not admit the higher charge by pleading guilty to the lower charge.

Id. at 372.

We are confronted with a similar situation here. Although trial court did not rely on “higher” charges in imposing sentence, he relied on additional, unproven, and unprosecuted charges. No facts before the court showed those charges were valid, and defendant did not admit the additional charges by pleading guilty to this charge. Nor did trial court make any finding whether facts existed to substantiate the charges. See State v. McKeever, 276 N.W.2d 385, 389 (Iowa 1979).

The Court of Appeals found Thompson was distinguishable on the basis that these unprosecuted offenses “were, at most, a secondary consideration in sentencing defendant.” We do not interpret trial court’s statement to indicate the additional charges were in fact a secondary consideration. But even if they were, we cannot speculate about the weight trial court mentally assigned this factor, or whether it tipped the scales to imprisonment. Other grounds existed to support the sentence imposed in Thompson, see 275 N.W.2d at 372 (Harris, J., dissenting), but nonetheless we struck down the sentence because the trial court impermissibly also considered the higher charge. Thus, we remand the case to the trial court for resentencing without consideration of the other charges unless the facts before the court show defendant committed those offenses or they are admitted by him. We do not suggest what the sentence should be. See Gibb, 303 N.W.2d at 688.

II. Defendant also contends his guilty plea was invalid because he did not know the prosecutor would mention the un-prosecuted charges at the sentencing hearing. Defendant did not object to the references to the additional charges at the sentencing hearing, when the error, if any, first became apparent, nor did he move to withdraw his guilty plea. See Iowa R.Crim.P. 8(2)(a). Thus, trial court was given no opportunity to rule on the validity of defendant’s guilty plea. See Gibb, 303 N.W.2d at 678. As long as the defendant has been duly advised of his or her rights before the guilty plea is accepted, as defendant was in this case, “it is the duty of defendant, before sentence is pronounced, to show good cause for its withdrawal or at least move that it be withdrawn. ’ State v. Lindsey, 171 N.W.2d 859, 861 (Iowa 1969).

Defendant could have challenged the validity of his guilty plea after the prosecutor referred to the unprosecuted charges at the sentencing hearing, if at that time he believed the plea bargain had been breached. Although trial court invited counsel for defendant to make further comment following the prosecutor’s statement, he did not. Matters not raised in the trial court ordinarily will not be considered for the first time upon appeal. State v. Jump, 269 N.W.2d 417, 430 (Iowa 1978). We have considered the other issues raised by defendant and find them to be without merit.

DECISION OF COURT OF APPEALS VACATED; REMANDED TO DISTRICT COURT FOR RESENTENCING.  