ROCKLAND, Maine — A Knox County grand jury indicted a 40-year-old Tenants Harbor man Wednesday on a murder charge in connection with the shooting death of a friend he said had supplied him with drugs for years.

Andrew J. Kierstead was indicted by a grand jury that met for three days this week and completed its work Wednesday afternoon. He is accused of the intentional and knowing murder of Richard L. Mills of Cushing on Sept. 27 outside Mills’ home at 40 Far Meadow Lane in Cushing.

Kierstead told police he fired a shotgun repeatedly at Mills because the victim had hooked him on drugs and had been supplying him for 10 or 15 years, but then shut him off for not paying.

Kierstead, 40, of Tenants Harbor was arrested the night of the shooting and charged with murder in connection with Mills’ death outside Mills’ home at 40 Far Meadow Lane in Cushing.

The Maine Attorney General’s Office presented the case to the grand jury.

An affidavit containing details of what police say happened was filed Oct. 1 in Rockland District Court by Maine State Police Sgt. Jason Richards of the Major Crimes Unit.

Kierstead appeared in Rockland District Court on Oct. 1, when he was ordered by Judge Susan Sparaco to be held without bail. A hearing had been scheduled for Oct. 9 to determine whether there is probable cause to continue holding him without bail but that will not be held now that he has been indicted.

Attorney Steven Peterson of Rockport represents Kierstead. Peterson said last week that his client’s state of mind at the time of the shooting will be critical for the defense.

Kierstead told police that after he shot Mills, he took pills with the intent to overdose, according to the affidavit.

“He later woke up and hoped it was a dream. He went outside and saw Mills and then called 911,” according to the affidavit.

Kierstead said he does not know when the shooting occurred. He called the Knox County Regional Communications Center about 8 p.m. Thursday from Mills’ home.

The Tenants Harbor man said he was an unemployed carpenter and had no money, according to the affidavit. He said Mills had supplied him with drugs after getting him hooked 10 or 15 years ago. Mills recently had fronted him $250 worth of pills but then on Thursday refused to give him more drugs until Kierstead paid off the debt.

“They argued and Kierstead got Mills to go outside and help him with a noise under the hood. When Mills was looking under the hood, Kierstead got a 12-gauge shotgun from the front seat and pointed it at Mills,” the affidavit from Richards stated.

Kierstead told police that he keeps the shotgun loaded and had been sleeping with it.

“Mills told him to put it away before someone got hurt. [Kierstead] then told them [officers] that he fired the shotgun at Mills. He pumped another round in and kept firing. He said he did not know how many shots he fired,” the affidavit stated.

Investigators said they found five 12-gauge casings near the truck. One gunshot hole was found in the truck.

Inside the residence, officers found a suicide note believed to have been written by Kierstead that explained why he shot Mills. The shotgun was found and so was one empty methadone pill bottle, one empty hydrocodone bottle, one hydrocodone bottle containing four tablets and one hydrocodone bottle containing 27 tablets.

The autopsy performed Sept. 28 by the Maine medical examiner’s office found four wounds to Mills’ front with 12-gauge slugs and one birdshot wound to his right buttock.

In a 911 call reviewed by state police, Kierstead allegedly told the dispatcher that he killed Mills over “f…ing drugs and sh..” He went on to say that Mills had “just totally f…ed up his life.”

Kierstead told state police Detectives Dean Jackson and Jason Andrews that he had been hooked on Percocet, Vicodin, methadone and other pills, according to the affidavit.

Lt. Kirk Guerrette and Detective Lt. Reggie Walker of the Knox County Sheriff’s Office were the first to arrive at the scene after Kierstead’s 911 call.