BOISE, Idaho -

The Idaho Court of Appeals has upheld a ruling granting a new sentence to a man convicted of grand theft.

In the ruling handed down last week, the appellate court said a judge in Adams County was correct in ordering a new sentencing hearing for Gregory Scott McAmis.

McAmis had appealed that decision, saying that he deserved a chance to withdraw his guilty plea.

According to the court documents, McAmis reached an agreement with prosecutors that he would plead guilty, and in exchange prosecutors would dismiss a persistent violator enhancement and ask for a 5-year term. But instead, the prosecutors recommended the sentence suggested by a pre-sentence investigator, and McAmis' attorney didn't object.

The appellate court said a resentencing, with prosecutors recommending the 5-year term, was an appropriate remedy.