SACO, Maine — A New Hampshire man will spend the next four years behind bars after he was sentenced Monday on robbery charges, police said.

Wayne Thompson, 27, of Derry, N.H. was sentenced to 10 years in prison with all but four years suspended and three years probation, according to Saco Deputy Chief Jeffrey Holland.

Thompson was sentenced by Justice Paul Fritzsche in York County Superior Court.

Thompson had been picked up by a taxicab driver in Biddeford on April 15, and upon entering the taxi, Thompson told the driver he had a knife and to hand over his money, according to Holland.

The following day, the same taxi driver picked up Thompson on Middle Street in Saco, and Thompson told the driver “I have a knife, just like last night. Give me your money or I will use it,” according to Holland.

Later that evening, Thompson threatened a clerk with the knife at the Cumberland Farms on Elm Street in Saco, fleeing that store with an undisclosed amount of cash.

Thompson fled the state via the Amtrak Downeaster later on April 16, but was later captured in Derry, N.H., the deputy chief said.

Thompson’s probation conditions include substance abuse and psychological evaluations, counseling, no contact with his victims, random searches and testing for drugs and alcohol and to not enter the Cumberland Farms on Elm Street in Saco.