FARMINGTON — A third man has been charged in connection with a heroin trafficking investigation in Farmington.

Chris A. Crockett, 56, of Farmington, was arrested Friday on charges of aggravated trafficking in scheduled drugs, Class A, and possession of firearms by a prohibited person, Class B, according to court documents.

Last month, Mark Barrett, 59, and Guy Stevens, 42, both of Farmington, were arrested on charges of aggravated trafficking of unlawful drugs and illegal importation of drugs when they were stopped by Farmington police while driving back from Massachusetts to Farmington with what police say was more than 1.3 ounces of heroin in the vehicle.

After the July arrests, Farmington police Officer Darin Gilbert got search warrants for the cellphones belonging to Barrett and Stevens and found text message conversations on each phone with Crockett that were consistent with heroin trafficking, the affidavit for Crockett’s arrest warrant said.

A warrant for Crockett’s arrest was issued Friday and he was arrested at his home the same day. He is being held at the Franklin County Jail in lieu of bail of $15,000 cash or $30,000 real estate surety.

The investigation – which includes the Farmington Police Department, the Wilton Police Department, the Franklin County Sheriff’s Office and Maine State Police – began in June when police received information that Barrett and Stevens allegedly were making trips to Massachusetts on Fridays to pick up heroin for resale and distribution in Maine, the affidavit said.

At the time of his arrest, Barrett was living with Crockett at his home on Lucy Knowles Road, where police said they found bottles containing 29 OxyContin pills, 15 oxycodone pills, 5 percocet pills and 24 pills of Ambien. None of these bottles had prescription labels and were located in Barrett’s gun safe, which also contained three shotguns, five rifles and 10 handguns, the affidavit said.

Gilbert interviewed Crockett at his home when the search warrant was executed on July 14, but Crockett said he “had no idea” Barrett allegedly was selling heroin.

Crockett told Gilbert he was aware that Barrett had firearms in the house but said he always kept them locked in the gun safe. As a convicted felon, Crockett is prohibited from possessing or having access to firearms. In 2013, Crockett was convicted in Franklin County Superior Court for eluding an officer, according to the affidavit.

At the time, Gilbert believed Crockett was telling the truth and told Franklin County Assistant District Attorney Jim Andrews that there was no clear evidence to believe Crockett was aware of the alleged trafficking or a firearms violation on his part at the time, the affidavit said.

After getting the search warrants for Barrett’s and Steven’s cellphones, which were found in Barrett’s vehicle after their arrests, Gilbert “found text message conversations between Mark Barrett and Chris Crockett consistent with drug trafficking, specifically heroin,” the affidavit states.

Gilbert also found text message conversations between Crockett and Stevens that indicate Crockett allegedly had the access code to the gun safe, where the 18 guns were found and where Barrett and Stevens allegedly were keeping the heroin.

The messages also indicate that Crockett allegedly was weighing heroin for Barrett and Stevens, Gilbert wrote in his affidavit.

Both Stevens and Barrett still are being held at the Franklin County Jail, a corrections officer said Tuesday afternoon.

Crockett is scheduled to appear in court at 1 p.m. Aug. 30, for a dispositional conference.

Gilbert said Tuesday that the investigation into the alleged trafficking operation is ongoing.

“Like any fairly large case, we’re always going to continue to look to see if there is any more information,” he said.