A Gardiner man was sentenced to two-and-a-half years in prison Tuesday in U.S. District Court in Portland for illegally possessing a firearm as a felon.

According to a news release from U.S. Attorney Halsey Frank, Robert Gay, 35, of Gardiner, was hired in June 2018 to do plumbing work at a residence in Scarborough. While working in the basement, he found and stole a rifle. Law enforcement officials said Gay’s cellphone contained text messages that confirmed that he had sold the rifle to a third party.

Gay was prohibited from possessing a firearm based on two felony theft convictions in 2018.

The rifle was located and returned to its owner, according to the release.

The case was investigated by Scarborough and Gardiner police departments, the FBI and the Bureau of Alcohol, Tobacco, Firearms and Explosives.