CAMBRIDGE, Md. (AP) — A mayor on Maryland’s Eastern Shore has resigned, weeks after he was charged with distributing revenge porn online.

Andrew Bradshaw, 32, who was the youngest mayor in Cambridge’s history when he took office last year, submitted his resignation around noon Monday, according to a statement the city posted on Facebook.

Bradshaw said in a statement Monday that he decided to resign after “a period of difficult self-reflection” and consideration of the “proper” path forward for the city and himself, news outlets reported. Bradshaw said he no longer had the confidence of his colleagues and hasn’t been able to maintain relationships with local, state and federal leaders necessary to move the city forward.

Bradshaw is accused of posting nude photos of a woman he was no longer in a romantic relationship with using multiple Reddit accounts. He was arrested in November and charged with 50 counts of distributing revenge porn and released on his own recognizance.

The woman contacted authorities in May after learning that the photos were posted. She told authorities she had sent the photos to Bradshaw while they were in an intimate relationship and that she didn’t give him permission to redistribute them.

Commissioners in the city of about 13,000 voted unanimously on Dec. 13 to issue a formal complaint to remove Bradshaw from office. A special election will be held to fill the remainder of Bradshaw’s term, the city said. In the meantime, Cambridge Commission President Lajan Cephas will assume mayoral duties.

A trial is set for April. If convicted, Bradshaw could face a maximum penalty of two years’ incarceration and a $5,000 fine for each count.