A Utah man is heading to federal prison after admitting he robbed a number of banks in Wyoming and Utah.

Thirty-eight year old James Thain was sentenced to 27 years in prison, followed by five years of probation, after he pleaded guilty to 14 federal charges.

Photo Courtesy: Rock Springs Police Dept.

Thain admitted to bank robberies in Rock Springs, Laramie and Casper, as well as nine bank and credit union robberies in Utah, all in December and January.

Photo Courtesy: Laramie Police Dept.

He admitted using a firearm in a crime of violence and to being a felon in possession of a firearm.

K2 Radio

Thain and 33-year-old Mindy Lawrence were arrested after a January robbery at the Bank of the West near the Eastridge Mall in Casper.

A customer in the drive-up line, suspected something was going on, and alerted police.

Authorities say Thain was homeless before his arrest.

Lawrence pleaded guilty to one charge of aiding and abetting with an armed robbery, and has already been sentenced.

Both Lawrence and Thain must also pay a combined $33,000 in restitution.

Thain's actual sentence was two 20 year prison terms, to be served concurrent with each other, or at the same time, followed by seven more years after that, and then five years of probation.