Police officers fatally shot a man who opened fire on officers, wounding three, during a SWAT standoff that began Tuesday night in northwest suburban South Elgin.

SWAT teams from South Elgin and Kane County and police officers from ten departments negotiated for nearly four hours with the man, who fired at officers from the balcony of an apartment complex.

Officers responded about 10:50 p.m. to reports of shots fired in the 300 block of Woodridge Circle, according to South Elgin Police Sgt. Mike Doty. When they arrived, the man fired two rounds from a shotgun at officers.

After taking cover, officers began negotiating with the man, who also aimed a scoped rifle at officers, police said. Officers did not return fire at that time.

“The individual began yelling vulgarities at the officers and stated he would shoot officers if they came at him,” Doty said.

Residents of the eight-unit apartment complex were evacuated about 11 p.m. Negotiations continued with the man, who moved from inside an apartment unit, to a balcony, to a stairwell in the complex, police said.

About 2:30 a.m., the man opened fire on officers a second time, and officers returned fire, fatally striking him, Doty said.

It was not clear where on the body he was shot, or how many times.

Three officers were struck during the shoot out and were taken to area hospitals to be treated for injuries that weren’t life threatening. A fourth officer who was not wounded, but was involved in the shooting, was taken to a hospital for observation, police said.

South Elgin Fire Protection District Steve Wascher said three of the officers were taken to Saint Joseph Hospital in Elgin while a fourth was taken to Sherman Hospital in Elgin.

Doty declined to release information about the wounded officers’ injuries or which departments they worked for pending notification of their families.

He said the scene was secured by 2:38 a.m. Residents were being allowed back into their homes early Tuesday.

The man’s age was not immediately known and the Kane County Coroner’s Office had not confirmed his death.