NAGINA, India — The teens were trapped.

As the protest broke up, Indian police officers in the town of Nagina chased a group of Muslim teenagers into an empty house. They grabbed them and took them to a makeshift jail. And then, the boys and community leaders said, the officers tortured them.

Four of the boys, who ranged in age from 13 to 17, said in interviews with The New York Times that police officers used wooden canes to beat them and threatened to kill them for taking part in demonstrations against a divisive citizenship law that has fueled rallies and rioting across India. Three had obvious signs of deep bruising or other injuries.

Many Indians fear that the new law, which is seen as a huge political victory for Prime Minister Narendra Modi and his Hindu nationalist base, is blatantly discriminatory toward Muslims and threatens the very foundation of India as a secular and tolerant nation.

In Uttar Pradesh, the northern Indian state where Nagina is and the one with the most Muslim residents, the rioting has been among the most intense, and the violent backlash from the police has been the most deadly and troubling.