St. Charles police said they responded to the 1500-block of East Main Street just after 11:30 p.m. for a report of a man who was running in and out of traffic.
When officers arrived, they tried to speak with Licurgo Diazsandi, police said.
Officials said at some point, he brandished a knife and charged at officers.
One officer deployed a Taser, which hit Diazsandi. Another fired his service weapon. Diazsandi was not shot, police said.
SEE ALSO: 2 killed in Back of the Yards shooting, Chicago police say
Diazsandi was taken to Northwestern Medicine Delnor Hospital and later released into police custody.
One of the officers involved was taken to a nearby hospital, per protocol.
Diazsandi has been charged with attempted murder, attempt to disarm a peace officer, aggravated assault to a peace officer with a weapon, criminal damage to government property and resisting a police officer.
He's currently being held at Kane County Jail.
Anyone who has information on the incident is asked to call St. Charles police at 630-377-4435.