A South Portland man who was found to be in possession of a deputy sheriff’s handgun after it was stolen and used in two robberies was sentenced Wednesday to serve 16 months in federal prison.

Bahman Habibi, 28, was found guilty of possession of a stolen handgun Oct. 30 after a jury trial in U.S. District Court in Portland.

Habibi was accused of storing the gun, a .40-caliber Glock pistol belonging to a Cumberland County Sheriff’s Office detective, after it was used by another man last year to rob a Cumberland Farms store on Cottage Road in South Portland on April 17 and a TD Bank branch on Market Street in South Portland, according to court records.

The gun and a badge were stolen from the detective’s personal car on Sept. 21, 2012, and subsequently used by Joseph Morrill, 24, of South Portland in the robberies. Morrill has since been sentenced to serve 13 years in prison.

Police and federal agents arrested Habibi after using cellphone information to track the gun to his home at 865 Broadway and confront him as they executed a search warrant there. Habibi admitted that he knew the gun was stolen and led them to where it was hidden in the basement, court records state.

Judge D. Brock Hornby also sentenced Habibi to serve three years of supervised release following completion of his prison term.

Scott Dolan can be reached at 791-6304 or at:

[email protected]

Twitter: @scottddolan