The suspect in a murder Thursday evening in Evergreen Park, identified as 32-year-old Jamal Parks, was fatally shot by police late Friday on a Metra train in north suburban Deerfield, officials said.

Officers with the South Suburban Major Crimes Task Force were tracking a suspect in the fatal Evergreen Park shooting and determined that he was onboard a northbound Metra train stopped at the Lake Cook Metra station in Deerfield about 10:30 p.m., according to Orland Park Police Chief Tim McCarthy, a spokesman for the task force.

Officers positioned themselves outside on the platform and inside the train, according to the Illinois State Police Public Integrity Task Force, which is investigating the shooting. Members of the Deerfield Police Department were called in to assist the task force officers.

When police boarded the train Parks, of Gurnee, ran to the train’s upper level, McCarthy and Illinois State Police said. Some of the officers began to evacuate the train of other passengers while other officers pursued him to the upper level and tried to take him into custody.

Parks resisted, broke free, pulled out a gun and fired multiple rounds at officers, McCarthy said. The officers retreated to the lower level and there was an exchange of gunfire between the suspect and police, during which the suspect was struck at least once.

Parks was taken to Highland Park Hospital, where he was later pronounced dead, McCarthy said. The Lake County coroner’s office was scheduled to perform an autopsy on him Monday.

At least 40 other passengers were on the train, Milwaukee District North Line No. 2155, at the time of the shooting, Metra spokeswoman Meg Reile said.

While officers had begun evacuating the train when they first boarded, there were still some passengers onboard when the shooting started, McCarthy said. None of them were injured.

Two task force officers suffered minor injuries during the struggle and were taken to hospitals, where they were treated and released, according to McCarthy. They were not struck by gunfire.

The passengers were brought to a nearby Home Depot store to stay warm while waiting for rides home, Reile said.

Inbound and outbound trains bypassed the station while authorities investigated overnight, but were making stops at the Lake Cook station again as of 8:49 a.m., according to a service update from Metra.