Thousands protested in rival demonstrations in India Friday as tensions deepen over a citizenship law seen as anti-Muslim, with authorities deploying huge numbers of riot police in the country.

Twenty-seven people have died in two weeks of at times violent demonstrations after Hindu nationalist Prime Minister Narendra Modi's government made it easier for non-Muslims from Pakistan, Afghanistan and Bangladesh to be naturalised.

Coupled with a mooted citizens register, it has stoked fears -- including in Washington and the UN rights office -- about the marginalisation of Muslims who make up 14 percent of India's 1.3 billion people.

The citizenship law has unleashed a wave of protests across India
The citizenship law has unleashed a wave of protests across India AFP / INDRANIL MUKHERJEE

Hundreds of armed policemen patrolled areas of the financial capital Mumbai, where demonstrators rallied both in favour of and against the legislation, underlining the divisions rippling through India.

First-time protester Amanda Castellino said she had joined the demonstrations "to safeguard India's secular ethos".

"At this moment, either we can stay silent and mute for the rest of our lives or speak up", the 27-year-old told AFP on the sidelines of the rally, which was attended by around 5,000 people.

The mass protests present Prime Minister Narendra Modi with his biggest challenge since coming to power in 2014
The mass protests present Prime Minister Narendra Modi with his biggest challenge since coming to power in 2014 AFP / Manjunath Kiran

A similar number of protesters showed up at a rival pro-government demonstration in the city, clutching flags and posters in favour of the new law.

"We should welcome persecuted Hindus back home without any restrictions," said Mahindra Shah, an 82-year-old protester.

"Why do Muslims need to come here when Pakistan, Afghanistan and Bangladesh are Muslim-dominated?"

Heavy-handed police tactics have fuelled anger, with many accusing authorities of arbitrary force against dissenters
Heavy-handed police tactics have fuelled anger, with many accusing authorities of arbitrary force against dissenters AFP / STR

Modi, facing his biggest challenge since storming to power in 2014, said on Sunday that Muslims whose "ancestors are the children of mother India" had nothing to fear.

Riot police and paramilitary troops erected steel barricades on roads leading to the mosque in old Delhi
Riot police and paramilitary troops erected steel barricades on roads leading to the mosque in old Delhi AFP / Jewel SAMAD

But his assurances have failed to ease fears, with the law unleashing a wave of protests involving Muslims and non-Muslims alike across the country.

Several state governments have also said they will refuse to implement the legislation, in a challenge to Modi's authority.

In Delhi, hundreds of demonstrators gathered outside the grand mosque in the capital's old quarter after Friday prayers.

Thousands of police were deployed as fresh protests erupted in Delhi and Mumbai against a citizenship law seen as anti-Muslim
Thousands of police were deployed as fresh protests erupted in Delhi and Mumbai against a citizenship law seen as anti-Muslim AFP / Prakash SINGH

Riot police and paramilitary troops erected steel barricades on roads leading to the mosque, where violent clashes broke out last week following protests.

On Friday, demonstrators chanted slogans against the government, vowing to keep up the pressure until the law was revoked and plans for the register cancelled.

"They want to drive out the poor, Muslims and those who don't agree with them," protester Muntazir Bashir told AFP.

Heavy-handed police tactics have fuelled anger, with many accusing authorities of arbitrary force against dissenters.

The northern state of Uttar Pradesh, where 20 percent of the population are Muslims, witnessed the worst violence, with 19 people killed, mostly from gunshot wounds.

Officials on Friday said they have suspended mobile internet and SMS services in 21 districts out of 75 including the state capital Lucknow.

Access to data on cellphones was only restored in many areas on Tuesday following a week-long cutoff in a country that activists say is the world leader in snapping internet access.

The protests in Uttar Pradesh, whose chief minister is a Hindu monk from Modi's right-wing Bharatiya Janata Party, are among the biggest there in decades.

State police have arrested more than 1,000 people and taken more than 5,000 others into preventive custody, some of them as young as 16 according to media. Around 200 people have been ordered to pay compensation for damage caused to public property during the protests.

More than 100 people have also been booked over social media posts deemed to be objectionable or misleading, with tens of thousands of messages on Twitter, Facebook and other platforms reported.

Authorities are keeping a close eye on foreigners with a Norwegian tourist saying she was told to leave India after participating in a protest in the southern state of Kerala.

This week a German student was also ejected after taking part in demonstrations in the southern city of Chennai, according to media reports.

Photos on social media purportedly of the student, named as Jakob Lindenthal, showed him carrying a placard saying "1933-1945 We have been there", in reference to his country's Nazi past.