India's southern Kerala state on Tuesday became the first state to legally challenge a new citizenship law that has triggered nationwide demonstrations.

The Kerala government, in its petition to the Supreme Court, called the law a violation of the secular nature of the Indian constitution and accused the government of dividing the nation on religious lines.

The citizenship law backed by Prime Minister Narendra Modi's Hindu nationalist party provides a path to naturalisation for people from Bangladesh, Afghanistan and Pakistan, unless they are Muslim. It has led to nationwide protests and clashes with police, leading to 23 deaths.

More:

"Kerala will always remain in the forefront of this fight to protect the Indian constitution and the fundamental rights of its citizens," said Chief Minister Pinarayi Vijayan.

"The suit that the Kerala government has filed in the Supreme Court today against the unconstitutional CAA is in line with this fight to save citizens' rights through constitutional methods," he told Al Jazeera.

"We are one of the first states to decide that we would not implement this law that violates the core of the constitution. We have also approached other chief ministers, respectful of the constitution, to take similar steps to defend it."

The rallies have slowly morphed into much wider anti-government protests.

Sunny Kappikkad, a prominent Dalit activist, said major protests against the CAA have come from the state governments - the first being from the West Bengal state, led by Chief Minister Mamata Banerjee.

"Kerala government has joined the mass protests by passing a resolution in the state legislature and now challenging the law in Supreme Court," Kappikkad told Al Jazeera.

"These are major moments in the anti-CAA protest. This adds relevance when we understand the fact that mass protests doesn't really influence the BJP government at the centre, as they have scant respect for the voice of the common man."

Critics say the law will be used in conjunction with a citizenship list that could require all Indians to produce documents proving their origins, a challenge in a country where many people lack official records, including birth certificates.

Political challenges for Modi over the passage of the new law are mounting with a number of Indian states saying they will not implement it.

Chief Minister Banerjee, a staunch Modi critic, has led several mass rallies in West Bengal against the law. Punjab, Rajasthan and Madhya Pradesh states, which are governed by the opposition Congress party, have also announced they will not impose the new law.

The law has also been rejected in the western state of Maharashtra, where Congress is part of a coalition government.

Modi's government insists that the law is needed to help persecuted non-Muslim minorities from Afghanistan, Bangladesh and Pakistan who came to India before 2015 by giving them Indian citizenship.

But critics have questioned why Tamil and Rohingya refugees from Sri Lanka and Myanmar respectively have been kept outside the purview of the new law.

Leena Reghunath contributed to this report from Kochi