WASECA, Minn. (AP) — Prosecutors in southern Minnesota charged a man with attempted murder on Wednesday, alleging he shot and gravely injured a police officer who was responding to a report of a suspicious person.

Tyler Robert Janovsky, 37, was charged in Waseca County District Court with three counts of attempted first-degree murder of a peace officer. Authorities allege Janovsky shot Waseca Officer Arik Matson in the head as Matson and other officers responded to a call of a suspicious person with a flashlight in a backyard Monday night.

READ MORE: Sign Bearing George Floyd's Name Unveiled At 38th And Chicago

READ MORE: ‘We’re Hearing Good Things’: Pastor Says Officer Arik Matson Is Improving After Shooting

Matson, 32, remained in critical condition Wednesday. Janovsky also is accused of shooting at two other officers — Sgt. Timothy Schroeder and Officer Andrew Harren. The Minnesota Bureau of Criminal Apprehension said Matson and Schroeder returned fire, and Janovsky was hit twice. He suffered non-life-threatening injuries and remained hospitalized Wednesday.

Online court records do not list a defense attorney who could speak on Janovsky’s behalf.

According to the criminal complaint, the Waseca officers were called to a residential area at about 8 p.m. Monday on a report of a suspicious person in a backyard with a flashlight. Officers made contact with Janovsky while he was on the back balcony of a house.

Officer Arik Matson (credit: CBS)

Harren went through the house onto the balcony to get Janovsky, but Janovsky fled — going onto the roof of an attached garage and crossing to the other side of the house, facing the front driveway. The complaint says Janovsky fired at Harren and missed. Janovsky then fired at Matson, who was in the driveway, and shot him in the head.

READ MORE: 'It's Bizarre': Southern Minnesota Ghost Town Still Attracting Summer Visitors

Janovsky was wanted on drug-related charges. Three weeks earlier, police raided his house and found methamphetamine, pseudoephedrine pills, other drugs and a handgun. A search warrant affidavit says a brother warned Janovsky, and he fled out a basement door.

Janovsky has several previous convictions, including for burglary, drug crimes and for making terrorist threats. He also was convicted of one count of being an accessory to murder in the 2001 strangulation of a 21-year-old man. The Star Tribune reported that Janovsky admitted driving another man to the victim’s home and waiting outside during the killing.

The charges filed Wednesday include a count of possessing ammunition or a firearm after a conviction of a crime of violence.

Matson has been with the Waseca Police Department since 2013 and is assigned to patrol. He is also a member of a regional drug investigative SWAT team and worked in a program designed to keep kids away from drugs, Chief Penny Vought said.

READ MORE: ‘He Gave A Darn About The People He Dealt With’: Community Honors Officer Arik Matson After Shooting

Early in his career, Matson worked at the Freeborn County Sheriff’s Office and was on night patrol with his father, Tim Matson, who was then a corporal with the Albert Lea Police Department, the Albert Lea Tribune reported in 2010.

Waseca is a city of about 9,400 located 70 miles (110 kilometers) south of Minneapolis.

MORE NEWS: Sign Bearing George Floyd's Name Unveiled At 38th And Chicago: 'This Is Just Another Step Forward'

(© Copyright 2020 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)