A Wilton man has been charged with drug trafficking for allegedly providing a woman with the heroin on which she overdosed and for hiding 4 grams of fentanyl in a remote-control car.

Kyle D. Campbell, 29, was arrested Tuesday and charged with aggravated trafficking in Schedule W drugs, a Class A felony.

His arrest followed a Maine Drug Enforcement Agency investigation into the Sept. 11 heroin overdose of a woman with whom Campbell lives.

The trafficking charge was elevated to an aggravated offense because Campbell allegedly possessed the drugs at his residence, which is within 1,000 feet of the Academy Hill School on Cameron Street in Wilton.

Wilton police responded to Campbell’s residence shortly before 9 a.m. Sunday for a report of a heroin overdose. The woman who overdosed was found in the bathroom. The woman told police that day that Campbell had gone to New Hampshire to purchase the heroin she used, though he was not initially charged, according to a drug agency affidavit filed with the court.

Following the overdose, police received consent from Campbell to search his cellphone for evidence of drug trafficking. On Tuesday, a drug agent joined the investigation and saw conversations that indicated where Campbell might be picking up heroin.

On Tuesday, Wilton Police Officer Derek Daley set up surveillance at Campbell’s home and where he was suspected to be purchasing heroin.

During the surveillance, officers saw Campbell walking to his home and operating a remote-control car. Campbell was about 40 feet from his front door when the officers approached him and both noted that “Campbell was very much focused on this remote car and trying to get it away from him and closer to the house,” according to the affidavit.

After Campbell told police he did not have any drugs or weapons, he gave Daley permission to look at the remote and the car. In the car, Daley saw a large bag containing powder and Campbell was placed under arrest and taken to the Wilton Police Department for questioning.

The bag contained 4 grams of what tested positive as fetanyl, though Campbell told police he believed he purchased 2 grams of heroin for $300.

Campbell was being held Friday at the Franklin County Jail in Farmington on $5,000 cash bail or a Maine Pre-Trial Services Contract.