A Yarmouth man has pleaded guilty to a federal gun charge for a pistol he had in the bedroom of a Portland apartment when he and his girlfriend were shot in 2010, resulting in her death. Cory Girard, 27, changed his plea to guilty on Thursday in U.S. District Court in Portland just days before he was scheduled to be tried on a charge of possessing a firearm while being an unlawful user of a controlled substance, marijuana.

Darien Richardson’s cold-case murder has stymied Portland police for years, and Girard has not been entirely cooperative with investigators. Richardson, 25, initially survived wounds to her thigh and hand, but died unexpectedly on Feb. 28, 2010, while visiting a friend in Miami, from a blood clot caused by her injuries. Girard was shot in the arm and survived.

Police have said that Girard was interviewed several times and denied knowing who shot him or Richardson.

Girard’s pistol was a .45 caliber semi-automatic, the same caliber weapon used to shoot him and Richardson, but authorities have determined that Girard’s .45 was not the gun used.

Judge D. Brock Hornby allowed Girard to remain free on an unsecured bond of $10,000 until his sentencing, which has not been set. Girard faces up to 10 years in federal prison and a fine of up to $10,000.

Federal authorities decided to charge Girard last year as the fifth anniversary of Richardson’s murder approached, but it is unclear whether Girard became more cooperative after he was arrested.

At the time of the shooting, Girard was dealing “large amounts” of oxycodone between New York and Maine, Assistant U.S. Attorney Darcie McElwee wrote in a prosecution document filed with the court.

“The firearm was seized by the Portland Police from the bedroom on the night of the shooting. Also seized from the bedroom that same night were approximately 193 counterfeit 80 mg Oxycontin pills and approximately 2.7 grams of marijuana,” McElwee wrote. “On about Jan. 8, 2010, the defendant was a daily user of marijuana and had been since the time of the firearm purchase in October 2009, having smoked marijuana as recently as the night of the shooting.”

McElwee, contacted by phone after Girard’s plea hearing, declined to comment on whether Girard was more cooperative with investigators since his arrest last Nov. 19.

Portland Police Detective Sgt. Dean Goodale also declined to comment on Girard’s plea and the status of the cold-case investigation into Richardson’s killing.

Girard’s attorney, Peter DeTroy, said the timing of Girard’s arrest last year coincided with the five-year statute of limitations for federal authorities to bring the criminal case against him.

DeTroy acknowledged that authorities investigating Richardson’s death had been hopeful that they would be able to get additional information from Girard, but he would not comment on whether Girard gave investigators what they wanted.

“I think it’s fair to say he’s pleaded guilty, acknowledging the charge. And he was questioned and answered the questions,” DeTroy said.

DeTroy added that Girard is a very different man than he was in 2010, no longer deals drugs and has a job.

“Obviously he was not using his best judgment during that time. His world got turned upside down that night (of the shooting),” DeTroy said.

Assistant Attorney General John Alsop, the state prosecutor leading the investigation into Richardson’s killing, declined to comment on the federal charge and would only say that Richardson’s killing “remains under investigation.”