CHICAGO (WGN) — A 19-year-old man has been charged after two Chicago officers were shot Sunday, according to police.

Jeffon Williams is charged with seven felony counts of attempted first-degree murder and one felony count of aggravated assault of a police officer.

One officer is still recovering after having surgery and will most likely remain hospitalized for a couple of days. The other officer was released Sunday afternoon.

Police said they are lucky to have survived.

“When officers leave home for their work shifts every evening, they never really know what the day holds, whether or not they will be asked to make the ultimate sacrifice,” said Police Supt. David Brown.

According to the Chicago Police Department, two officers pulled a car over on the city’s West Side around 2:30 a.m. Sunday.

Police said the officers saw a gun inside the car during the stop and asked a man inside to get out, but after he locked himself in the car, the officers broke the car windows and attempted to arrest him.

After a struggle, both officers were shot — one in the chest and shoulder and the other in the chest, back and arm, police said. They said a third officer at the scene shot the suspect.

Williams was hospitalized in critical condition. He is expected to survive.

Williams was due in bond court Monday.

Officials said the two officers involved in the traffic stop are in their 20s and have been on the force for two years. They were recently assigned to a new unit targeting hot spots of violence in the city.