The Anchorage man accused of firing a handgun through the ceiling of his apartment, critically injuring a woman in the apartment above him, told police it was an accident, according to charging documents.

Joseph Lock, 22, was charged with first-degree assault following the shooting on the 5300 block of Mockingbird Drive. The woman, who was shot in a third-floor apartment, was in serious condition Monday morning, according to Providence Alaska Medical Center staff.

Police detective James Anderson said in an affidavit against Lock that officers responded to the shooting just before 2 a.m. Saturday.

"(The victim) was transported to a local hospital with life-threatening injuries," Anderson wrote. "The bullet entered her lower back and exited near her shoulder, puncturing her heart."

Anderson said that when police spoke with Lock, who was hosting the party in the downstairs apartment, he first claimed to have only heard the shot before admitting that he fired it. Lock told police he had consumed "a large amount of alcohol and some marijuana" prior to firing the pistol, which he said was brought to the party and shown to him by a man he didn't know, the charging document said.

"Lock said he checked to see that the pistol was not loaded then dry-fired it at a stuffed giraffe," Anderson wrote. "Lock said a short time later he was handling the same gun again and assumed it was still unloaded. Lock said he was dancing with the gun in his hand and accidentally fired it into the ceiling."

After the gunshot, Lock told police, he dropped the gun; the man who brought it then "picked it up and ran out."