ANCHORAGE, Alaska — A gunman repeatedly shot an Alaska police officer in an ambush early Saturday morning as the officer lay on the ground near his police cruiser, Anchorage police said.

The officer was expected to survive and was undergoing emergency surgery, department spokeswoman Jennifer Castro said.

The wounded officer and another officer who responded exchanged gunfire with the man, who was killed.

The shooting happened before 5 a.m. in downtown Anchorage as the officer was responding to reports of a theft suspect in the area on foot.

“The officer was pulling his patrol vehicle over and a man brandished a gun and started firing at the officer,” Castro told the Associated Press.

Additional officers arrived and provided first aid to both the officer and the suspect, who was declared dead, Castro said. Police haven’t released the shooter’s name.

Per department policy, the names of the two officers who fired their weapons will not be released for three days. Both the department and the state will conduct reviews to determine if the use of force was within department guidelines and justified.