PORTLAND, Ore. (AP) — A 22-year-old Portland man has been charged with manslaughter after authorities say he accidentally shot his brother with a firearm they had been trying to figure out how to operate.

The Multnomah County District Attorney’s Office on Monday filed the charge against Angel C. Martinez in the death of Christian Martinez, The Oregonian/OregonLive reported. The shooting happened Saturday in a Portland apartment complex.

Martinez flagged down a Portland police officer and said he had shot his brother, who was inside the apartment with a fatal gunshot wound to the chest, according to a probable cause affidavit filed with Multnomah County Circuit Court by Deputy District Attorney Amanda Nadell.

During his interview with police, Martinez said he had recently purchased a revolver and his brother wanted to look at it. Martinez said his brother looked at the firearm and said it was not working, so he passed it to the defendant, Nadell wrote in the affidavit.

The defendant said it was pointed at the victim when he pulled the trigger, Nadell wrote.

Martinez told police that he had fully loaded the gun after purchasing it. He said he did not check to see if the weapon was loaded when he pointed it at his brother, the court record says.