NEW DELHI — Kaushar Ali, a house painter, was trying to get home when he ran into a battle.

Hindu and Muslim mobs were hurling rocks at each other, blocking a street he needed to cross to get to his children. Mr. Ali, who is Muslim, said that he turned to some police officers for help. That was his mistake.

The officers threw him onto the ground, he said, and cracked him on the head. They started beating him and several other Muslims. As the men lay bleeding, begging for mercy — one of them died two days later from internal injuries — the officers laughed, jabbed them with their sticks and made them sing the national anthem. That abuse, on Feb. 24, was captured on video.

“The police were toying with us,” Mr. Ali said. He recalled them saying, “Even if we kill you, nothing will happen to us.”

So far, they have been right.

India has suffered its worst sectarian bloodshed in years, in what many here see as the inevitable result of Hindu extremism that has flourished under the government of Prime Minister Narendra Modi. His party has embraced a militant brand of Hindu nationalism and its leaders have openly vilified Indian Muslims. In recent months Mr. Modi has presided over a raft of policies widely seen as anti-Muslim, such as erasing the statehood of what had been India’s only Muslim-majority state, Jammu and Kashmir.