Two Chicago police officers have been fatally struck by a train as they investigated a report of gunshots in the city.

Eduardo Marmolejo, 37, and Conrad Gary, 31, were pursuing a person who had headed toward train tracks and were hit shortly after 6pm as the commuter train passed through the area, Police Superintendent Eddie Johnson said.

“There was no stop at that location so the train was probably going somewhere between 60 and 70 miles per hour,” he said.

Mr Johnson said an individual was taken into custody and a weapon was recovered, but that the investigation was still in the early stages.

Mr Marmolejo had been with the department for two-and-a-half years and Mr Gary for 18 months, Mr Johnson said.

Chicago Mayor Rahm Emanuel said the city had lost “two young men, both fathers with young families”.

“There are no words that can express the grief, the sense of loss. It just knocks you back on your heels,” he said.

Eduardo Marmolejo
Eduardo Marmolejo (Chicago Police Department/AP)

Chicago police use so-called ShotSpotter technology, or sensors that monitor for the sound of gunfire and alert police.

Mr Johnson said the two officers went to the scene Monday after an alert went out.

“It just highlights again how dangerous this job can be. I often say that the most dangerous thing a police officer can do is take a weapon off of an armed individual,” he said.

The train that struck the officers was operated by a commuter rail line that links northern Indiana and Chicago, according to media reports.

Conrad Gary
Conrad Gary (Chicago Police Department/AP)

In 2002, Chicago police officer Benjamin Perez was fatally struck by a commuter train while conducting surveillance on drugs activity on the city’s West Side.

Two other Chicago officers have already been killed in the line of duty this year.

Officer Samuel Jimenez was killed in a shootout last month after he chased a gunman inside a hospital on Chicago’s South Side.

The gunman also killed two other people — his ex-fiance who was an emergency room doctor and a pharmacy resident — before taking his own life.

And in February, Commander Paul Bauer was fatally shot while pursuing a suspect in the Loop business district.

“I think it’s really important that we put our arms around the Chicago Police Department and hold them up and support them at this critical juncture, because we are so dependent on their professionalism and their sense of duty,” Mr Emanuel said.