Protests have erupted across parts of India over a bill that precludes Muslims from other countries from gaining Indian citizenship.

The lower house of Parliament passed legislation early Tuesday that will grant citizenship to Hindus, Sikhs, Buddhists, Jains, Parsis and Christians who escape persecution in neighboring Muslim-majority nations like Afghanistan, Bangladesh and Pakistan. Muslims from those states would not be eligible for Indian citizenship.

The bill, which passed 311-80, serves as an amendment to the Citizenship Act of 1955, which banned illegal migrants from applying for Indian citizenship.

Prime Minister Narendra Modi praised the legislation.

“This bill is in line with India’s centuriesold ethos of assimilation and belief in humanitarian values,” he tweeted.

Members of Modi’s ruling Bharatiya Janata Party (BJP) now say they might have enough support in the upper house to push the bill through and make it law. But BJP currently lacks a majority in the upper house, meaning some opposition lawmakers and allies will have to support the bill to make it law.

Some human rights groups and Islamic organizations have condemned the bill and claimed the government is trying to marginalize Muslims.

More than 1,000 scientists and scholars signed a petition calling for the bill in its present form to be withdrawn. Pratap Bhanu Mehta, an academic and former president of the Center for Policy Research, a New Delhi-based think tank, said the legislation will turn India into an "unconstitutional ethnocracy.”

Civil rights activist Harsh Mander said in protest of the bill he will “officially register as a Muslim” and will “demand the same punishment as any undocumented Muslim.”

During parliamentary debate, opposition Congress politician Shashi Tharoor said the bill “infringes upon the principle of equality before law.”

Asaduddin Owaisi, a Muslim lawmaker, said: “We are heading toward totalitarianism, a fascist state. We are making India a theocratic country.”

The bill also excludes certain other minorities, including Tamils from Sri Lanka, Rohingya from Myanmar and Tibetans from China.

But Home Minister Amit Shah denied such criticism, saying Muslims are not themselves persecuted in Pakistan, Bangladesh or Afghanistan.

“I say this again and again, that this bill has nothing to do with the Muslims in this country,” Shah said. “The Muslims in this country will be able to live here with dignity, are living here, and will continue to do so. What are we doing now? We are giving the minority their rights.”

Senior BJP leader Ram Madhav countered that "no country in the world accepts illegal migration.”

"For all others about whom the bleeding hearts are complaining, Indian citizenship laws are there,” Madhav added. “Naturalized citizenship is an option for others who legally claim Indian citizenship. All other illegal [immigrants] will be [considered] infiltrators.”

Ravi Kishan, a member of Parliament and former actor who supports the bill, said: “There are Muslim countries, there are Jew countries, everybody has their own identity. And we are a billion-plus, right? We must have one identity. India has always been a Hindu nation. The Muslims also are Hindus [meaning, Muslims in India are recent converts to Islam].”

The bill is particularly irksome to people in India’s northeast which is dealing with a large influx of illegal immigrants, including many Hindus, from neighboring Bangladesh. Under the bill, these foreign Hindus would have the right to become Indian citizens.

Parts of the northeast were crippled by strikes, which led to school closures.

“The [strikes] have drawn a total response in the northeastern states,” said Samujjal Bhattacharyya of the North East Students’ Organization. “We have made it clear that [the citizenship amendment bill] will not be accepted and we are going to intensify our agitation. Assam and northeastern states had already taken a huge burden of illegal foreigners.”

The All Assam Students' Union has vowed to launch "vigorous mass agitation" against the bill.

Some American groups also condemned the bill. The U.S. Commission on International Religious Freedom even called for sanctions against Shah, citing the bill as a “dangerous turn in [the] wrong direction.”

“It runs counter to India's rich history of secular pluralism and the Indian Constitution, which guarantees equality before the law regardless of faith," the commission added.

In the U.S. Congress, the House Foreign Affairs Committee tweeted: "Religious pluralism is central to the foundations of both India and the United States and is one of our core shared values.”

The panel also tweeted: "Any religious test for citizenship undermines this most basic democratic tenet.”

Gautam Bhatia, a Delhi lawyer, told BBC that by dividing migrants into Muslims and non-Muslims, the bill "explicitly and blatantly, seeks to enshrine religious discrimination into law, contrary to our long-standing, secular constitutional ethos.”

Historian Mukul Kesavan saidf the bill’s principal purpose is the “delegitimization of Muslims citizenship.”

Linked to the citizenship is another piece of legislation that was introduced last month by Amit Shah – the National Register of Citizens of India -- that will count the vast country’s citizens and seek to expel all illegal immigrants by 2024,