Prime Minister Narendra Modi's government did not anticipate the protests against a new citizenship law that have raged across the country and is now scrambling to control the damage, members of his ruling party said.

In Modi's biggest challenge since taking office in 2014, hundreds of thousands have protested against the law offering citizenship to immigrants from non-Muslim minorities who have fled Afghanistan, Bangladesh and Pakistan.

At least 21 people have died in clashes with police.

Ruling Bharatiya Janata Party (BJP) leaders were taken aback by the backlash, some party members told Reuters. They said they had been prepared for some anger from Muslims, but not the widespread protests that have convulsed most major cities for two weeks.

Now the party and the government are reaching out for help in defusing the crisis to allies and opponents sidelined when the bill passed earlier this month, the sources said.

"I really did not see the protests coming ... not just me, other BJP lawmakers were also unable to predict this kind of anger," union minister Sanjeev Balyan, told Reuters.

While there is no threat to his big parliamentary majority, the 69-year-old Modi's reputation as a master strategist with his finger on the pulse of the people has taken a hit.

Publicly, his government has prioritised development, seeking to make India a $5 trillion economy by 2025.

Outrage at the citizenship law has been fanned by resentment against the government for not addressing an economic slowdown and loss of jobs.

CITIES CONVULSED

Many Muslims fear the new law - and a planned national citizenship register - could make the minority second-class citizens. Students, politicians and rights activists, both Hindus and Muslims, have also taken to the streets, saying the government is jeopardising India's secular constitution.

The government denies the citizenship register is imminent and says none of the changes will affect existing citizens.

Three other BJP lawmakers and two union ministers, who spoke on condition of anonymity, said they were mobilizing party supporters from all walks of life to start community dialogues and dispel discontent over the law and the register.

"I believe that the political math behind the clearance of this law was not taken into account," said one of the union ministers, an apparent reference to lack of consultation with allies and opposition parties.

Home Minister Amit Shah, widely seen as the second most powerful man in the country, repeated in a television interview on Tuesday that Muslims had no cause for worry.

"We are all in damage control mode," said the other union minister, adding that the BJP and hardline Hindu allies have launched a campaign to explain that the law is not discriminatory.

The Rashtriya Swayamsevak Sangh (RSS), which is the ideological parent of the BJP, has also launched a movement across urban slums to counter opposition to the bill.

"The violent protests are not because the people were not properly informed about the new law, but because they were intentionally wrongly informed by forces with vested interests," Manmohan Vaidya, a senior RSS leader, told Reuters.

"AUTOCRATIC STYLE"

Analysts say various reasons for discontent were coalescing.

"It's evident that people are protesting against the law and also venting against Modi's autocratic style of leadership," said Sanjay Kumar, director of research institute the Centre for the Study of Developing Societies.

"The economic crisis gives further incentive ... I don't see these protests fading very soon."

When Modi, a veteran politician and son of a tea seller, came to power five-and-a-half years ago, he promised growth, jobs and development. But he was criticised for haphazard tax reform and shock demonetisation of high value currency notes in his first term - which contributed to an economic slowdown.

Nevertheless, he was re-elected with an even stronger majority earlier this year after a strong response to a security standoff with old foe Pakistan.

In August, Modi's government withdrew semi-autonomous privileges for Jammu and Kashmir, India's only Muslim-majority state, and downgraded it to a union territory.

In November, the Supreme Court ruled in favour of the construction of a Ram Temple in Ayodhya ending a decades-old point of communal tensions. The government welcomed the decision.

Then came the citizenship law.

"I feel they can't create jobs and hence they are passing such a disturbing law," said Ghanshyam Tiwari, a student protesting in the city of Lucknow this month.

The protests are backed by the opposition Congress party, which has dominated Indian politics for most of the 72 years since independence but was soundly beaten in the last two national elections.

"For the first time in India's history a law has been framed on the basis of religion," Prithviraj Chavan, a senior Congress leader, told Reuters. "The ruling party's strategy to make India a Hindu-first nation has backfired."