ROCKLAND — A Dexter man with a long criminal record is being held in jail after being arrested Wednesday, accused of selling the deadly drug fentanyl that killed a Thomaston man earlier this year.

Joshua R. Nickerson, 39, is charged with Class A aggravated trafficking in drugs that caused a death. He was also charged with aggravated trafficking with a prior conviction.

The case centers on the death of Ryan Gamage who died Jan. 6 at the age of 32 from a drug overdose.

Judge Paul Mathews set bail at $25,000 cash, more than the $5,000 cash sought by Nickerson’s attorney for the day William Pagnano and also more than the $15,000 sought by Assistant Attorney General John Risler.

The judge said the nature of the crime, Nickerson’s lengthy criminal record, and his record of failing to appear for court hearings shows that the suspect is a “dangerous threat to public safety.”

Nickerson only spoke to say he understood the charges and his rights. He appeared pale and left the courtroom briefly when he became ill.

An affidavit filed in the Knox County court by the Knox County Sheriff’s Office details the investigation which led to Nickerson’s arrest.

Investigators checked Gamage’s cellphone and found texts and Facebook messages between Nickerson and Gamage that discussed arranging a drug transaction. Gamage went to a Wal-Mart in Palmyra to pick up the drugs from Nickerson, according to the affidavit.

Surveillance video from the Wal-Mart in that central Maine town showed Nickerson in the store and also showed his vehicle and Gamage’s vehicle in the parking lot. That video coincided with messages about the pending transaction.

The Maine Medical Examiner’s Office determined Gamage’s cause of death as acute intoxication from fentanyl and sertraline. Gamage had a prescription for the sertraline which is used to treat depression and anxiety.

Gamage died at the residence of Sydni Barham on Mill Street in Rockport, according to the affidavit.

Maine Drug Enforcement Agency agents and Knox County Detective Donald Murray traveled to Dexter on Wednesday, May 8. They interviewed Nickerson who initially denied selling drugs to Gamage but said he had sold drugs to other people. He later admitted selling to Gamage but said it was a small amount, according to the affidavit.

Prosecutor Risler told the court that Nickerson sold five grams of heroin and fentanyl to Gamage for $500. Risler said Nickerson’s record was “abysmal” which dates back to 1998 and includes multiple burglaries, assaults, and drugs.

The maximum sentence for the new drug charge is 30 years in prison.

Gamage’s family attended the hearing for Nickerson.

His family has worked with the Mid-Coast Recovery Coalition since Gamage’s death to raise money for The Friends House in Rockland which will provide a residence for men in recovery from substance abuse.

Comments are not available on this story.