The Colorado police officer badly injured in a shooting earlier this week has been credited for her bravery after confronting the suspected gunman during a shooting rampage that resulted in five deaths, including the suspect.

Lakewood Police Agent Ashley Ferris engaged Lyndon McLeod, 47, moments after he fatally shot a 28-year-old worker at a Hyatt in the town of Belmar, police said. A police statement said Ferris ordered the suspect to drop his weapon as he approached.

Lakewood Police Agent Ashley Ferris was credited for her bravery during a shooting spree earlier this week. (Lakewood Police )

"The suspect ignored her commands" and fired a shot into her abdomen, police said. Ferris managed to return fire. The suspect was struck and died at the scene.

Lakewood Police Agent Ashley Ferris is expected to make a full recovery.

Ferris underwent surgery Monday night and is expected to make a full recovery.

DENVER-AREA GUNMAN WHO KILLED TATTOO ARTISTS MAY HAVE ACTED OUT SCENE FROM HIS OWN DARK NOVEL: REPORTS

"I can’t overemphasize enough the heroic actions of our Lakewood police agent," police said during a news conference Tuesday. "In the face of being shot, in the face of danger, she was able to not only save others from this terrible tragedy but also neutralize the threat."

Dec. 28: Workers confer close to a sheet of plywood covering a window of a pizza parlor in Lakewood, Colo., near one of the scenes of a shooting spree that left five people dead—including the suspected shooter Monday evening—and left three more people wounded. (AP Photo/David Zalubowski) (AP Photo/David Zalubowski)

"If not for the heroic efforts of Agent Ferris and other law enforcement, this incredibly violent tragedy could have been even worse," the statement said.

GET THE FOX NEWS APP

McLeod knew most of the people he shot through business or personal relationships, police have said. Four of the people who were shot were attacked at tattoo shops.

The Associated Press contributed to this report