SPOKANE — A state appeals court has allowed a Grant County man to withdraw his guilty plea for the 2015 killing of two of his co-workers in Royal City, court documents show.

Eduardo Ibarra Valencia was charged in November 2015 with first-degree murder and attempted first-degree murder for shooting two of his co-workers at Callahan Manufacturing, killing one of them.

In 2017, those charges were amended to second-degree murder and attempted second-degree murder, both with firearm enhancements. On the same day the charges were amended, Ibarra Valencia took a plea bargain with the state, and both sides agreed to a 20-year sentence.

But the court rejected the plea agreement, instead sentencing him to just over 28 years in prison for the charges, and adding an additional 10 years for each of the two firearm enhancements for a total of 48 years.

Within two weeks of sentencing, the Department of Corrections (DOC) reported that Ibarra Valencia’s offender score was lower than the court had believed when it made its sentencing decision, resulting in about a 9% overstatement of the sentencing range. The DOC also noted that the court had erroneously imposed a 10-year sentence for each of the firearm enhancements.

Prosecutors moved to amend Ibarra Valencia’s sentence, but Ibarra Valencia asked to withdraw his guilty plea while the motion was still pending.

Typically, a defendant cannot withdraw a guilty plea after judgment except under extraordinary circumstances. Prosecutors opposed Ibarra Valencia’s attempt to withdraw his plea, arguing that he had to show not only that his guilty plea had been made involuntarily, but that if he had known the maximum sentence he faced was 9% lower, a reasonable person would have therefore gone to court.

The trial court, saying it was erring on the side of caution, allowed Ibarra Valencia’s request. In upholding that decision, a state appeals court wrote Thursday that, because both sides immediately agreed that Ibarra Valencia’s sentence was incorrect, it could not be considered final judgment. Therefore, the defendant had the right to withdraw his plea, the court wrote.