A Biddeford man allegedly dealt drugs out of a tent near a school.

Brandon Gelsomini, 28, has been charged with aggravated drug trafficking and violation of his conditions of release, according to the Maine Drug Enforcement Agency.

His arrest follows a two-month investigation into reports that Gelsomini was dealing drugs out of a tent in an encampment adjacent to railroad tracks along James Street near Biddeford High School, the MDEA said Wednesday evening.

Police executed a search warrant at Gelsomini’s tent early Wednesday morning. During a search of his tent, officers found 120 grams of fentanyl, 21 grams of powder cocaine, 5 grams of crack cocaine, a loaded shotgun and about $7,000 in suspected drug proceeds, according to the MDEA.

The drugs are worth an estimated $14,000.

Gelsomini was taken to the York County Jail in Alfred, where he was being held withhold bail pending a court appearance on Halloween.

The investigation is ongoing.