MIDDLETON, Wis. — The suspect in a Wisconsin workplace shooting that seriously injured three people this week had his concealed-carry permit revoked and was unable to legally purchase a firearm, police said Friday.

Middleton Police Chief Chuck Foulke said the gunman, 43-year-old Anthony Tong, had "contact" with police in South Dakota in 2004 that involved a mental health issue. Foulke didn't give details of the South Dakota incident, but he cautioned against concluding that mental health was an issue in Wednesday's shooting at WTS Paradigm in Middleton.

Foulke said police still don't know what motivated the Wednesday morning attack. Tong, who had worked at the company since April 2017 and had no criminal history in the state, was fatally shot by police responding to the incident.

The police chief said the Bureau of Alcohol, Tobacco, Firearms and Explosives is tracking down the origin of the 9mm semiautomatic pistol used in the attack.

A women is escorted from the scene of a shooting at a software company in Middleton, Wis., on Sept. 19, 2018. Four people were shot and wounded during the shooting in the suburb of Madison, according to a city administrator. Steve Apps / AP

Authorities also said Friday that the conditions of three workers seriously injured had improved. The woman and two men have been upgraded from serious to fair condition at University Hospital in Madison, according to UW Health. A fourth employee suffered a graze wound during the attack. Their names haven't been released.

Police don't know if the victims were targeted or shot at random.

Officers were called to WTS Paradigm in Middleton, a Madison suburb of about 17,440 people, just before 10:30 a.m. on Wednesday. Foulke said officers arrived within 8 minutes of receiving emergency calls and found a man wielding a semiautomatic pistol. Foulke said the man was also carrying extra magazines.

Two Middleton officers and two Dane County sheriff's deputies exchanged gunfire with Tong, killing him. The officers and deputies were not hurt, according to police.

WTS Paradigm makes software for the building products industry. A Wisconsin State Journal profile from 2014 listed company employment at about 145 workers and noted the company was looking to move to a larger location at the time.

The company has posted You Tube videos depicting a loose atmosphere in an upscale office marked by a breakroom that resembles a bar, a ping-pong table and a shuffleboard table, and workers in jeans and sweatshirts.

One video depicts an office Olympics in which workers compete by pedaling themselves around in their chairs and toss garbage in wastebaskets. Another video touts the company's charity contributions, including donations to the Madison Children's Museum, the American Diabetes Association and Habitat for Humanity.