FARMINGTON — Two Farmington men were arrested early Thursday on charges of aggravated drug trafficking following a monthslong investigation by multiple local agencies.

Mark Barrett, 59, and Guy Stevens, 42, were each arrested on charges of aggravated trafficking of unlawful drugs and illegal importation of drugs shortly after midnight when they were stopped by Farmington Police Officer Erin Gilbert with heroin in the vehicle.

A search of Barret’s 2006 Honda Accord yielded more than 1.3 ounces of heroin, which has a street value of about $6,000 to $8,000, according to Farmington Police Chief Jack Peck. Barrett was also armed with a loaded handgun at the time of the arrest, which elevated both trafficking charges to a Class A felony.

Investigators – from departments including the Farmington Police Department, the Wilton Police Department, the Franklin County Sheriff’s office and Maine State Police – had received a tip this week that the two men would be driving back to Farmington, and got search warrants for the men’s homes and vehicles.

Following the vehicle stop and arrests, officers from the four agencies searched the men’s residences, both of which are on Lucy Knowles Road.

The search of Barrett’s residence turned up “hundreds of small zip-lock plastic baggies, typically used for packaging and re-sale of illegal drugs,” a release from Peck said.

Also found in Barrett’s home were three shotguns, five rifles, 12 handguns and multiple boxes of ammunition.

All items, including Barrett’s car, were seized as evidence.

A search of Stevens’ home produced no evidence pertinent to the investigation, Peck said.

It is not yet known where Barrett and Stevens were traveling from when they were stopped, but Peck said that determining where the men were allegedly importing heroin from is a key focus of the investigation.