The lone suspect in a Wisconsin workplace shooting has died after being shot by responding officers, according to police.

Middleton Police Chief Chuck Foulke said officers were alerted to an active shooter situation at software company WTS Paradigm around 10:25am. Mr Foulkes said the suspect was fatally shot by officers.

Mr Foulke did not release details about the suspect or how the attack unfolded. He said officers were still interviewing witnesses, many of whom fled the office building or hid inside after gunshots rang out.

Mr Foulke said three people were injured in the shooting, though the City Administrator Mike Davis said earlier that the number of injured was four.

A total of five patients were taken to hospitals in nearby Madison following the shooting.

According to the hospitals, one patient was in critical condition on Wednesday afternoon, two were in serious condition, and one had injuries that were not life-threatening. The condition of the other was not released.

Police have not released details about how the shooting unfolded, but witnesses said they heard gunfire around 10am.

Judy Lahmers, a business analyst at WTS Paradigm, said she was working at her desk when she heard what sounded “like somebody was dropping boards on the ground, really loud”.

Ms Lahmers said she ran out of the building and hid behind a car.

She said the building’s glass entrance door shattered.

“I’m not looking back, I’m running as fast as I can. You just wonder, ‘Do you hide or do you run?'” she told The Associated Press.

She said she knew that one co-worker had been grazed by a bullet but was OK. She did not have any other information about the shooting, but said it was “totally unexpected. We’re all software people. We have a good group”.

Police conducted a secondary search of the area on Wednesday afternoon to ensure there were no more victims or suspects, and discovered some people were still hiding in the building, which also houses Esker Software.