The accused was asked to surrender but he kept firing at the police, leading to an encounter, police said.