A man who Anchorage police say fired a gun during an altercation with two officers earlier this week has been arrested on a series of charges, including attempted murder.

Court records show Pagopago Beefcake Lelilio, 29, also facing seven other counts of assault, weapons misconduct and reckless endangerment in the Wednesday encounter.

A criminal complaint against Lelilio written by police Detective Monique Doll said that the events leading to his arrest began Tuesday night, with reports of shots fired in Mountain View. Witnesses told responding officers that three vehicles, including a Jeep SUV, a blue Chevrolet truck and a dark pickup truck, were involved with the gunfire. Police spoke with the Jeep’s driver, who was later arrested on a probation violation.

On Wednesday, police received another shots-fired report from the 4400 block of Parsons Avenue. Responding officers found three vehicles — the same Jeep from Tuesday’s call, as well as a dark truck with no license plates and a third unidentified vehicle. When police approached the dark truck, a man later identified as Lelilio opened a rear door and ran away.

Two officers, Nicholas Saldana and Ryan Proegler, chased Lelilio, who resisted arrest and began to struggle with them.

“(Lelilio’s) right arm was curled under his body, with his hand in his coat pocket on a pistol,” Doll wrote. “Lelilio fired the pistol (while still in his pocket) (narrowly) missing Officer Proegler and Officer Saldana. Officer Proegler stated he looked over to find the barrel of the pistol (still in the jacket pocket) pointed at he and Officer Saldana.”

Another officer arrived and used a Taser on Lelilio, allowing police to take him into custody. Proegler told investigators he thought Lelilio was trying to shoot him or Saldana when the gun fired.

Lelilio, who has prior Anchorage assault convictions from 2012, 2013 and 2015, was taken to the Anchorage Jail. Court records show he was arraigned there Thursday, and a statewide inmate database listed him as in custody Friday morning.