A Turkish police officer was stabbed to death in Istanbul late Sunday by a suspected Islamic State terrorist, state media reported.

The knife-wielding attacker reportedly had been arrested on suspicion he was preparing to carry out a suicide attack, and was in custody en route to the police station when the stabbing unfolded. The suspect reportedly was shot and killed after the stabbing.

The officer died in an ambulance on the way to the hospital and the attacker was shot dead immediately after the attack. It is not yet known how the suspect was able to keep a knife hidden following his arrest.