A man was shot dead by police after he held 23 children hostage in the Indian state of Uttar Pradesh on Thursday.

According to local reports, the accused, identified as Subhash Batham, invited the children to his home for his one-year-old daughter’s birthday party. He then held them hostage. When the villagers tried to rescue the children, Batham shot one of the villagers who was rushed to a nearby hospital.

When the police arrived at the scene, the accused opened fire and also threw a hand grenade at them. Three officers were injured in the firing. Police entered the building and fatally shot the accused following a standoff that lasted for 10 hours. All the children, including a six-month-old baby, were rescued.

"On learning that he had firing capabilities and after his bomb-threats, all senior police officials decided to attack him. We tried entering the house...Subhash was killed during the encounter,” said Uttar Pradesh Director General of Police Om Prakash Singh.

Batham was a murder convict who was sentenced to life imprisonment. He was out on bail. According to reports, the man wanted to take revenge against the villagers as he believed they were responsible for his arrest.

Meanwhile, his wife was stoned to death by the villagers following the Thursday night’s incident.

india crime
Representational image of police officials investigating a crime scene in Bangalore, Karnataka, in southern India, Sept. 5, 2017. MANJUNATH KIRAN/AFP/Getty Images