Clashes have continued between Indian police and protesters angered by a new citizenship law that excludes Muslims, as the prime minister, Narendra Modi, used a rally for his Hindu nationalist party to defend the legislation, accusing the opposition of pushing the country into a “fear psychosis”.

Twenty-three people have been killed nationwide since the law was passed in parliament earlier this month in protests that represent the first major roadblock for Modi’s Hindu nationalist agenda since his party’s landslide re-election last spring.

Most of the deaths have occurred in the northern state of Uttar Pradesh, where 20% of the state’s 200 million people are Muslim. Police, who deny any wrongdoing, said that among the 15 people killed in the state was an eight-year-old boy who died in a stampede in the city of Varanasi, the heart of Modi’s parliamentary constituency. Since last week, police in Uttar Pradesh have taken nearly 900 people into custody for engaging in violence.

Authorities across the country have scrambled to contain the situation, banning public gatherings and blocking internet access. India’s Ministry of Information and Broadcasting issued an advisory on Friday night asking broadcasters across the country to refrain from using content that could inflame further violence.

Modi took the stage at a rally in the capital, launching his Bharatiya Janata party’s campaign for New Delhi legislative assembly elections in February, and quickly turned to the contentious new law.

“People who are trying to spread lies and fear, look at my work. If you see any trace of divisiveness in my work, show it to the world,” he said.

‘They will lock us up or just kill us’: Muslims fearful in West Bengal Read more

Modi accused the main opposition Congress party of conspiring “to push not only New Delhi but other parts of the country into a fear psychosis”.

“They are trying every tactic to push me out of power,” he said, urging protesters to desist from attacks on police and other violence.

The law allows Hindus, Christians and other religious minorities who are in India illegally to become citizens if they can show they were persecuted because of their religion in Muslim-majority Bangladesh, Pakistan and Afghanistan. It does not apply to Muslims.

Critics have slammed the legislation as a violation of India’s secular constitution and have called it the latest effort by Modi’s government to marginalise the country’s 200 million Muslims.

Protests against the law come amid an ongoing crackdown in Muslim-majority Kashmir, the restive Himalayan region stripped of its semi-autonomous status and demoted from a state into a federal territory in August.

The demonstrations also follow a contentious process in the north-eastern state of Assam designed to weed out foreigners living in the country illegally. Nearly 2 million people, about half-Hindu and half-Muslim, were excluded from an official list of citizens – called the National Register of Citizens, or NRC – and have been asked to prove their citizenship or else be considered foreign.

India is building a detention centre for some of the tens of thousands of people who the courts are expected to ultimately determine have entered illegally. Modi’s home affairs minister, Amit Shah, has pledged to roll out the process nationwide.

“First, we will bring the citizenship amendment bill and will give citizenship to the Hindu, Buddhist, Sikh, Jain and Christian refugees, the religious minorities from the neighbouring nations. Then, we will implement NRC to flush out the infiltrators from our country,” Shah said in an election speech last April.

On Sunday, Modi denied the existence of a detention centre, accusing the Congress party of spreading fear that Indian Muslims would be jailed there. He also said that his opponents resented him for his work strengthening India’s ties to Iran, Saudi Arabia and other Islamic countries.

A small band of supporters of Modi’s party marched in New Delhi on Sunday. Activists from India’s north-east, a mainly tribal area where people fear an influx of migrants will dilute their culture and political sway, also held a rally in the capital.

The protests against the law began in Assam, the centre of a decades-old movement against migrants, before spreading to predominantly Muslim universities and then nationwide.