The former mayor of a Maryland college town pleaded guilty Wednesday to more than 100 counts connected to the possession and distribution of child sexual abuse material.

Patrick Wojahn had been the mayor of College Park — home to the state's flagship University of Maryland campus — up until March, when he was arrested.

Prince George's County State's Attorney Aisha Braveboy's office said the plea deal calls for Wojahn to serve a 30-year prison sentence.

COLLEGE PARK, MARYLAND, MAYOR ARRESTED FOR CHILD PORNOGRAPHY, POLICE SAY

He will be formally sentenced in November.

College Park, Maryland Mayor Patrick Wojahn seen in mugshot

Patrick Wojahn, the former mayor of College Park, Maryland, has pleaded guilty to over 100 counts connected to possessing and distributing child sexual abuse materials. (Prince Georges County Police Department)

ILLEGAL IMMIGRANTS GET OK TO VOTE IN MARYLAND CITY'S ELECTIONS

Police investigated Wojahn, 47, after receiving a tip in February from the National Center for Missing and Exploited Children about a social media account that was eventually traced back to him.

Wojahn had served as mayor since 2015.

CLICK HERE TO GET THE FOX NEWS APP

An attorney listed in online court records did not immediately return an email seeking comment Wednesday evening. When Wojahn stepped down, he said in his resignation letter he planned to "deal with my own mental health."