CHICAGO (CBS) — Hours before 45-year-old Gary Martin shot and killed five co-workers at the Henry Pratt Company plant in Aurora, he allegedly threatened “If I get fired, I’m going to kill every mother f***** in here,” according to a new report from the Kane County State’s Attorney’s office.

On Feb. 15, Martin opened fire inside the Henry Pratt warehouse in Aurora after he was told he was being fired for a safety violation. He killed five fellow employees, and wounded one other. He also shot and wounded five police officers who responded to the shooting before he was killed in a shootout with police.

After the shooting, the Kane County State’s Attorney’s office launched a formal investigation of the officers’ use of force. In determining the officers were justified in shooting Martin, investigators also revealed Martin knew he likely was being fired when he showed up for work that day and threatened to respond with violence.

According to the use of force investigation, he spoke to a few employees after he arrived for work at 6:45 a.m. and told them he was worried he might be fired for a safety violation.

“If I get fired, I’m going to kill every mother f***** in here,” he allegedly told one employee. “I am going to blow police up.”

The Kane County State’s Attorney’s office said that employee did not report Martin’s threat because “he believed that the offender was always making ‘off the wall’ statements and therefore was not concerned.”

While that employee knew Martin had a gun in his car, he had never seen him with the weapon inside the warehouse and wasn’t aware Martin was carrying the gun at work that morning. Prosecutors said it’s believed Martin brought the gun and ammunition inside the building when he arrived at work because there is no surveillance video of him returning to his car before the shooting.

Five employees of the company were fatally shot that day, including human resources manager Clayton Parks, 32, of Elgin,; human resources intern and Northern Illinois University student Trevor Wehner, 21, of Dekalb; hold operator Russell Beyer, 47, of Yorkville; stock room attendant and fork lift operator Vicente Juarez, 54, of Oswego; and plant manager Josh Pinkard, 37, of Oswego. Another employee, union steward Timothy Williams, was wounded in the attack.

According to prosecutors’ report on the shooting, Parks sent Williams a text message at 1 p.m. the day of the shooting, regarding a disciplinary meeting with Martin, who was being written up for not wearing his safety glasses.

Beyer spoke to Martin and brought him to a private office for the meeting with Parks, Pinkard, Wehner, Williams, and Beyer. Prosecutors said Martin was seen walking to his workstation to retrieve something and putting on a hoody after speaking to Beyer. He then went into the bathroom before walking into the meeting.

Once in the meeting, he was immediately told he was being written up for the safety violation, and the company would begin the termination process.

Martin then began shouting profanities, and Pinkard told him, “Ok, it’s over,” according to the Kane County State’s Attorney’s report.

Martin replied, “Yeah, it is over,” before he started shooting. Parks, Beyer, Wehner, and Pinkard were killed in the attack.

Williams was shot in the wrist and ran out of the room to warn other employees Martin was shooting. Martin chased him and shot him twice in the back, according to the report. Williams survived but doctors were not able to remove two bullets lodged in his back.

After shooting Williams, Martin then made his way to the loading dock, where he shot and killed Juarez. Witnesses said he specifically targeted Juarez.

Video from inside the warehouse shows Martin then positioning himself near a doorway, armed with a handgun, before police officers arrived on the scene.

An approximately 8-and-a-half minute-long surveillance video released by police earlier this month shows Martin as he prepares to ambush approaching officers. In the video, which is split into four screens, officers can be seen as they approach and enter the Henry Pratt facility, while Martin is seen on one of the screens showing the foyer of the interior. Armed with a firearm, he moves back and forth throughout the area, appearing to pace.

The only video of the interior of the building was shot in the foyer area, and the video has no sound.

According to prosecutors’ report on the shooting, five officers fired shots at Martin during the incident, although the report does not state how many total shots were fired by police. Martin himself fired at least 64 shots from a Smith & Wesson .40 caliber semi-automatic handgun, according to the report.

“All peace officers who responded to the incident scene and fired their weapons at the offender were justified in doing so,” Kane County State’s Attorney Joseph McMahon concluded in his report. “The offender had just committed multiple acts of First Degree Murder and was still armed with a firearm and ammunition for the weapon. The offender fired multiple gunshots at police officers arriving at the location of the incident without provocation or legal justification.”

The report states Martin was shot at least six times, including one self-inflicted wound to the head.

The report was released the same morning dozens of police officers, dispatchers, and other personnel were honored for their actions during the shooting. More than 40 Aurora Police Department employees received commendations, medals and special awards.

Aurora Mayor Richard Irvin praised their dedication to protecting others with pride.

“As our city was gripped with fear and uncertainty, there was a group of champions who forged beyond fear, pushed past the pain, and came to grips with the grief; yet continued to carry out their mission,” Irvin said.

Those honored ranged from 911 dispatchers to officers at the scene of the shooting, including one whose first day on the job was the day of the shooting.

Meantime, Williams has filed a lawsuit against Illinois State Police, seeking $2 million in damages; for issuing him a gun license despite a previous felony conviction and failing to make sure he surrendered his gun when that license was revoked.

Illinois State Police have said when Martin applied for a Firearm Owner’s Identification card in 2014, their criminal background check did not reveal a 1995 conviction for aggravated assault in Mississippi. The conviction wasn’t discovered until five days later in a new background check after Martin applied for a concealed carry license and submitted his fingerprints to speed up the application.

Martin’s Mississippi arrest did not show up in databases because his Mississippi state identification number did not appear in the system until after the Henry Pratt shooting more than two decades after he pleaded guilty to aggravated assault involving a former girlfriend.

State police also acknowledged lapses in enforcement of FOID card laws after a review of how Martin was allowed to keep the gun used in the Aurora shooting after his FOID card was revoked.