A Utah man who went on the run after being accidentally released from jail is expected to spend more than 18 years in federal prison after pleading guilty to eight criminal counts Tuesday.

During a hearing in U.S. District Court, Robert Douglas Preece agreed to plead guilty to armed robbery, carjacking, brandishing a firearm during a crime of violence and possession of a firearm by a convicted felon.

As part of his plea agreement, Preece agreed to be sentenced to 18 1/2 years and has waived his rights to appeal the sentence.

Preece, a convicted killer, was being held in the Salt Lake County Jail for robbing several Salt Lake valley businesses at knifepoint and then carjacking a vehicle and leading police on a high-speed chase, which resulted in a foot chase and his apprehension.

Due to an error, jail staff released Preece on Sept. 18, 2007. On Oct. 12, Preece robbed a credit union at gunpoint and later fled the state, robbing several other businesses and banks. He was later arrested in Portland, Ore., that November.

In court Tuesday, Preece said he had been high on heroin during the robberies. "I am grateful that nobody was hurt," he said.

Preece is scheduled to be sentenced Oct. 2.

E-mail: [email protected]