(CNN) Three people were seriously wounded Wednesday morning when a coworker opened fire at a software firm in a small Wisconsin city, police said.

The gunman, who was critically injured during an exchange of gunfire with law enforcement officers, died later at a hospital, Middleton police said.

His identity has not been released. The suspect, a US citizen in his 40s, did not have any known criminal record or family who lived in the area, Chief Charles Foulke said Thursday.

Authorities searched the suspect's residence on the southwest side of Madison on Wednesday night. It's unknown if the gun used in the shooting was owned legally. But police said he did not have a Wisconsin conceal-and-carry permit.

The Bureau of Alcohol, Tobacco, Firearms and Explosives is investigating where the weapon was originally purchased.

Read More