ROCKLAND, Maine — A former state drug enforcement officer was grilled on the stand Monday about his drug use as a convicted cocaine trafficker sought a new trial.

Lt. Kirk Guerrette of the Knox County Sheriff’s Office testified for nearly an hour in Knox County Superior Court about his use and acquisition of various prescription and over-the-counter drugs to help with his insomnia.

The hearing was held on behalf of 36-year-old Kaihlil T.P. Nigro of Portland. Nigro was convicted in December 2009 on two counts of trafficking in cocaine. In March 2010, Justice Jeffrey Hjelm sentenced Nigro to 10 years in prison with all but seven years suspended.

Defense attorney Jeremy Pratt is arguing that evidence that Guerrette was under investigation for drug use was not provided to the defense during Nigro’s trial. Pratt said Guerrette’s testimony could have been challenged based on his abuse of the drugs.

Guerrette was unsuccessful Monday in blocking the release of his medical records.

Hjelm ruled that the constitutional rights of a defendant in a criminal trial made those records public and superseded the federal health care privacy law.

Guerrette testified Monday that his use of sleep aids never affected his ability to work as a police officer. He was assigned by the sheriff’s office to work with Maine Drug Enforcement Agency from 2007-10. The officer said his stint with the MDEA ended when Sheriff Donna Dennison asked him to return to the sheriff’s department.

Jeffrey Wrigley, a detective for the Maine Attorney General’s Office, testified Monday that investigators who had been looking into the prescription practices of the former Goodnow’s Pharmacy in Rockland had come across records showing an unusually high number of prescriptions for Guerrette.

Wrigley acknowledged that investigators discussed whether Guerrette should remain in law enforcement out of concern for whether he could do the job based on the amount of drugs he was taking. The detective said he informed the MDEA at the time about the information he collected.

The detective said the investigators also discussed whether Guerrette should be prosecuted criminally but that the decision rested in the hands of prosecutors. The Attorney General’s office concluded its investigation in May 2012 without charging Guerrette or anyone else with an offense.

Under questioning by Pratt, Guerrette said Monday that while he was taking twice the amount of sleep medication he had been prescribed as well as other over-the-counter sleep aids, he did not believe he was abusing those drugs.

“I was taking what I considered to be the therapeutic level,” Guerrette said.

The officer acknowledged that on one occasion, he received an additional number of sleep pills from a Goodnow pharmacist on a Sunday when the pharmacy was closed.

The lieutenant also testified that he was later asked by that same pharmacist to provide an official police service and watch over the destruction of drugs from the pharmacy. Guerrette said he did not record the drugs or the amounts being destroyed because they were not evidence in a trial. He said he watched as the pharmacist flushed the drugs down a toilet. There was no one else around at the time the drugs were flushed, he testified.

Pratt is claiming that Guerrette’s recall of events during his testimony at the December 2009 trial could have been challenged based on his use of the drugs. Guerrette said that when he stopped using one sleep aid, he went two days without sleep. However, Wrigley testified that Guerrette had said he had gone two weeks without sleep.

Pratt also challenged Guerrette’s testimony and recollection that he was certain a confidential informant had said that Nigro was the person dealing in drugs. The identification of Nigro by the informant had not been allowed at trial because the informant had only been shown two photographs in a photo lineup with the other person being someone else the informant knew.

Nigro had worked as a holistic healer in Portland.

While working as an MDEA agent, Guerrette arrested Nigro Sept. 1, 2009. Guerrette found in Nigro’s pocket a combination to a safe that he was keeping at a Rockland residence. The house where Nigro held his drugs was located between the former Rockland District High School and the MacDougal School, according to court records.

When officers opened Nigro’s safe, they found approximately 17 1-gram bags of cocaine and 12 eight-ball bags, which hold about 3.8 to 4 grams of cocaine each, according to police reports. Also in the safe were scales and drug packaging materials.

Nigro has been serving his sentence since his conviction.