FORT LUPTON, Colo. — The Fort Lupton officer who was injured during an exchange of gunfire with an armed suspect was shot in the face and has undergone two surgeries since the shooting, according to an arrest affidavit for the suspect from the Greeley Police Department.

That same document identified the officer as Sgt. Christopher Pelton.

Matthew Cotter, 19, faces a charge of attempted first-degree murder and two counts of assault. He's accused of shooting Pelton late Monday night during an incident on Ponderosa Place.

RELATED: Fort Lupton officer, suspect critically wounded in shooting

Just before 8 a.m. Tuesday morning, detectives met with Cotter, and he waived his rights and agreed to speak with them.

Cotter told detectives he was at the home at 282 Ponderosa Pl. and heard police sirens approaching, the affidavit says. He took a handgun from the car, loaded a round in the chamber and then ran and hid behind a fence, according to the affidavit.

He told detectives, according to the affidavit, that he saw officers arrive through a slat in the fence, and then "admitted shooting three or four rounds from his handgun at an officer."

"I shot, he dropped, they shot, I dropped," Cotter said, according to the document.

Cotter added he "caught the officer off guard," according to the affidavit and then "detailed how he focused on his gunsights when aiming at the officer" from a position on the ground.

After firing the shots, Cotter said he heard other officers approaching and attempted to run away, but was immediately shot and taken into custody.

Officers initially responded to the home on Ponderosa Place around  9 p.m. on Dec. 2 after a resident called the police and said that her daughter's ex-boyfriend, identified as Cotter had threatened to harm her daughter and then kill himself, the affidavit says.

Officers checked the area, but did not find Cotter or his vehicle, which was described as a gray Ford Focus, the affidavit says.

About two hours later, there was another call for help from that same home, according to the affidavit.

This time, the caller said that Cotter was parked outside the home with his lights turned off and sent a text message to his ex-girlfriend saying, "It's too late," the affidavit says. The caller then told dispatch that Cotter was armed.

Officers arrived at the home but did not see Cotter, they requested that dispatch have someone from inside the home come and meet them, the affidavit says.

At about 10:49 p.m. an officer announced over the radio that shots had been fired and that an officer and Cotter had been shot. Both were transported to the hospital.

Detectives interviewed Cotter's ex-girlfriend, who said she ended her relationship with him in August 2019 and since then he has expressed suicidal thoughts, the affidavit says.

About a month ago, she said, she left work and found Cotter waiting for her in the parking lot. According to the affidavit, Cotter gave her a bullet and said he planned to shoot himself.

>> Northern Colorado Police and Fire Families is raising funds for Sgt. Christopher Pelton

SUGGESTED VIDEOS | Local stories from 9NEWS