A Gray man who was recently released from prison after attacking another man with a baseball bat is back behind bars after his arrest in Rangeley on heroin trafficking charges.

Police charged Tyler McFarland, 31, of Gray, Jami Driscoll, 23 of Auburn and Michael Chandler, 33 of Philadelphia in connection without he trafficking case.

Agents with the Maine Drug Enforcement Agency searched a home and a motel room Monday morning and seized 157 bags of heroin, 20 grams of crack cocaine and $8,200 in cash as well oxycodone and amphetamine capsules, police said.

Agents had been investigating a crack cocaine and heroin distribution ring in the Rangeley area for several months and learned over the weekend that Chandler was allegedly bringing a shipment to the area from Philadelphia.

The three are scheduled to appear in Franklin County Superior Court on Wednesday.

McFarland was sentenced in 2009 for attacking a man in Gray with a baseball bat and stealing drugs. He was sentenced to four years in prison and recently released. He is on probation.