WASECA, Minn. — Prosecutors have charged a man in a shooting that left a Waseca police officer gravely injured.

Tyler Robert Janovsky, 37, of Waseca, faces three counts of attempted murder, as well as a felony for illegal gun possession, according to court documents.

RELATED: Friends describe injured Waseca police officer as a 'really good guy'

RELATED: Officer, suspect in Waseca shooting incident identified

On Monday night, police officers were sent to the 900 block of 3rd Avenue SE in Waseca, on a report of a suspicious person with a flashlight.

Officers spotted Janovsky on a home's balcony.

According to a criminal complaint, after Officer Andrew Harren entered the home, Janovsky jumped onto the garage.

The complaint states that Janovsky ran across the "garage roof and crossed to the other side, facing the front of the house and the front driveway. Officer Arik Matson, Sergeant Tim Schroeder and Captain Kris Markeson circled around the house."

According to the complaint, Janovsky fired a shot at Officer Harren, which missed, but Janovsky fired his gun again and hit Officer Matson in the head. 

Police officers exchanged gunfire with Janovsky and he was eventually shot twice.

Both injured men were flown to North Memorial Hospital by air ambulance. 

The injuries to Janovsky are non-life threatening, while Officer Matson is in critical condition.