An initial background check five years ago failed to flag an out-of-state felony conviction that would have prevented a man from buying the gun he used to kill five co-workers and wound six other people, including five responding police officers, at a suburban Chicago manufacturing plant, authorities say.

Gary Martin, who was killed in a shootout with officers Friday, ending his deadly rampage at the Henry Pratt Co. in Aurora, was issued a firearm owner's identification card in January 2014 after a background check failed to show a 1995 aggravated assault conviction in Mississippi, Aurora police Chief Kristen Ziman said Saturday.

He bought the Smith & Wesson handgun he used in Friday's attack two months later, on March 11, 2014, she said. Five days after that, he applied for a concealed carry permit, which included a more rigorous background check that used digital fingerprinting and that did flag his Mississippi felony conviction, which led the Illinois State Police to revoke his permit.

"Absolutely, he was not supposed to be in possession of a firearm," Ziman said.

Martin was able to keep his gun despite losing his permit, raising questions about what, if anything, the state did to get him to relinquish it.

Authorities said Saturday that Martin pulled out the gun and began shooting right after hearing he was being fired from his job of 15 years at the industrial valve manufacturer.

Martin killed the other three people in the room with him and two others just outside, Ziman said. Among those killed was a college student starting a human resources internship at the plant that day. Martin also wounded a sixth worker — who is expected to survive — before police began arriving, drawing his attention toward them.

After wounding five officers and with law enforcement from throughout the region pouring in to help, Martin ran off and hid in the back of the building, where officers found him about an hour later and killed him during an exchange of gunfire, police said. All of the wounded officers are expected to live.

"He was probably waiting for us to get to him there," police Lt. Rick Robertson said. "It was just a very short gunfight and it was over, so he was basically in the back waiting for us and fired upon us and our officers fired."

Martin, 45, was no stranger to police in Aurora, where he had been arrested six times over the years for what Ziman described as "traffic and domestic battery-related issues" and for violating an order of protection.

Scott Hall, president and CEO of Mueller Water Products Inc., which owns Henry Pratt, said at a news conference Saturday that Martin was being fired "for a culmination of various workplace rules violations," though he didn't elaborate.

He said a company background check of Martin when he joined Henry Pratt 15 years ago did not turn up the 1995 felony conviction in Mississippi.

A vigil was planned for Sunday in Aurora, which is about 40 miles (65 kilometers) west of Chicago and is Illinois' second-largest city, with about 200,000 people.

Police identified the slain workers as human resources manager Clayton Parks of Elgin; plant manager Josh Pinkard of Oswego; mold operator Russell Beyer of Yorkville; stock room attendant and fork lift operator Vicente Juarez of Oswego; and Trevor Wehner, the new intern and a Northern Illinois University student who lived in DeKalb and grew up in Sheridan.

It was Wehner's first day on the job, his uncle Jay Wehner told The Associated Press. Trevor Wehner, 21, was on the dean's list at NIU's business college and was on track to graduate in May with a degree in human resource management.

"He always, always was happy. I have no bad words for him. He was a wonderful person. You can't say anything but nice things about him," Jay Wehner said of his nephew.

___

Associated Press writers Carrie Antlfinger and Amanda Seitz contributed to this report. Babwin and Rousseau reported from Chicago.