A Brunswick man was being held in the Cumberland County Jail in Portland on $25,000 bail after police seized 40 grams of heroin and charged him with trafficking in the drug.

Police arrested Justin Ryan, 42, on Monday on the felony charge and say the drugs seized are worth $10,000 on the street.

The arrest is the culmination of a month-long investigation by the Maine Drug Enforcement Agency and the Sagadahoc County Sheriff’s Office into allegations that Ryan was distributing heroin in the Bath-Brunswick area.

Investigators asked Brunswick police to stop Ryan’s car on Pleasant Street because they believed he was returning to Maine from Massachusetts with a large amount of heroin. They found the drugs in the car’s center console, police said.

Ryan was already free on bail from a 2014 arrest on charges of possessing and selling heroin, police said.

Agents searched Ryan’s apartment on Dunning Street and seized scales, packaging material and $1,300 in suspected drug proceeds, police said.