The Edgartown man who was accused of robbing the Rockland Trust in Falmouth earlier this year pleaded guilty in federal court Thursday. 

Petar Petyoshin, who was arrested in May for stealing $21,000 from the Davis Straits bank while brandishing a gun and claiming he had a bomb, entered the guilty plea to a charge of armed bank robbery in U.S. District Court in Boston. 

He is scheduled to be sentenced in January. 

The charge can carry a 25 year jail sentence, though prosecutors – in light of a plea agreement from Mr. Petyoshin – recommended he be sentenced to between five and nine years.

Police say Mr. Petyoshin robbed the bank at gunpoint in April while sporting a blond wig, sunglasses and a surgical mask. He allegedly told bank employees he had a bomb and fled in a car he stole from a customer. 

At the time of the robbery, Mr. Petyoshin worked for the Oak Bluffs water district and officials say he owned a clothing store on Circuit avenue. Several of the items he was wearing from the robbery, including the wig, appear to have come from the store.  

After the arrest, police searched Mr. Petyoshin’s Edgartown apartment and found thousands of dollars in cash bundled together in Rockland Trust money bands, according to prosecutors. Police also seized nearly 60 guns and a large amount of ammunition. 

Mr. Petyoshin was originally arraigned in Falmouth District Court before he was indicted by a federal grand jury.