The Edgartown man accused of robbing a Falmouth bank earlier this year has agreed to plead guilty in federal court.

Petar Petyoshin, who was arrested in May for allegedly stealing more than $21,000 from the Davis Straits Rockland Trust, signed a plea agreement with prosecutors earlier this summer. The August 10 agreement says he will plead guilty to one count of armed bank robbery.

The charge can carry up to 25 years in jail, but, with the guilty plea, the U.S. Department of Justice recommends Mr. Petyoshin be sentenced to between five and nine years of incarceration.

Mr. Petyoshin is scheduled to have a status conference on Oct. 10 and is expected to officially enter his plea on Oct. 12.

Police say Mr. Petyoshin robbed the bank at gunpoint in April while wearing a blond wig, sunglasses and a surgical mask. An employee at the Oak Bluffs water district, he also allegedly told bank employees he had a bomb and fled in a car he stole from a customer.

After the arrest, police searched Mr. Petyoshin’s apartment and found thousands of dollars in cash bundled together in Rockland Trust money bands, according to prosecutors.

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