Police say a suspected Islamic militant fatally stabbed a police officer at a police detention center near Indonesia's capital before being fatally shot by other officers.

National police spokesman Setyo Wasisto said the attack occurred late Thursday at the headquarters of the elite Mobile Brigade police in Depok, on Jakarta's southern outskirts, hours after 155 Islamic militant prisoners who earlier took over the headquarters and killed five officers surrendered to police.

Wasisto said Friday the attacker used a hidden knife to stab an officer who was questioning him about why he was near the headquarters.

Separately on Thursday, police arrested four suspected militants who allegedly planned to attack the headquarters following the prison clash. Police said two of them resisted arrest and were shot and injured.