A man with a lengthy criminal history pleaded guilty Tuesday to three counts of burglary.

Robert Wilson was scheduled to stand trial this week for two burglaries and a theft, but a last minute plea deal sent him to prison before the trial got under way. Wilson was sentenced to 37 years for burglary of a habitation; 20 years for burglary of a building and 25 years for theft. The sentences are set to run concurrently.

District Attorney John Terrill said that during plea negotiations, Wilson also admitted to burglarizing the Texas A&M Extension Station in February and the Village Flee Market in March.

Terrill said the plea agreement allowed his office to clear five felony cases.

Grady Swindle was appointed to represent Wilson in all three cases.

He called Wilson’s agreement to the plea deal “reasonable” in light of the fact that he faced 25-99 years or life in prison on two of the charges.

“For him (Wilson), this was the best thing he could have done,” Swindle said. “The evidence was against him - and this was a fair resolution.”

Sara Vanden Berge covers courts, law enforcement, and business and political issues for the Empire-Tribune. She can be reached at sara.vandenberge@empiretribune.com. Her work number is 968-2379, ext. 240.