Indian lawmakers approved legislation Wednesday granting citizenship to migrants from Pakistan, Bangladesh and Afghanistan, but only if they are not Muslim.

The bill passed the upper house of parliament by 125 to 105 after clearing the lower house on Monday. It now needs to be signed by the country's ceremonial president, a formailty before becoming law.

The citizenship amendment bill grants Indian nationality to Buddhists, Christians, Hindus, Jains, Parsis and Sikhs who fled the three countries before 2015.

The bill has sparked protests across the country by critics who say it is discriminatory and that it violates India’s secular principles. The ruling Hindu Nationalist Bharatiya Janata Party (BJP) argues it will give sanctuary to people fleeing religious persecution in those nations.

Prime Minister Narendra Modi, a member of the BJP, introduced the bill after his election victory in May.

Indian students protest against the Citizenship Amendment Bill (CAB) in Gauhati, India, Monday, Dec. 9, 2019. (AP Photo/Anupam Nath)

MARKET FIRE IN NEW DELHI, INDIA, KILLS AT LEAST 43, SPARKS CHAOS OUTSIDE HOSPITAL

BJP leader home minister Amit Shah said the bill is not anti-Muslim because it does not affect the existing path to citizenship available to everyone.

"The Muslims of this country don't have to worry about anything," Shah said in parliament, according to BBC News. "But should the Muslims of Pakistan be made citizens? Should Muslims from Bangladesh and Afghanistan and the rest of the world also be given citizenship? The country cannot run like this. The citizenship will be given only to persecuted religious minorities only from these three countries."

INDIA POLICE FATALLY SHOOT 4 SUSPECTS IN VETERINARIAN'S GANG RAPE, MURDER 

But more than 700 prominent Indian personalities, including lawyers, academics and actors, have signed a statement “categorically” condemning the bill, saying the government seems "intent on causing huge upheavals within Indian society.”

Muslim MP Asaddudin Owaisi said it was  “worse than Hitler’s laws and a conspiracy to make Muslims stateless."

Indian protesters hold Citizenship Amendment Bill (CAB) placards during a shutdown protest against the Citizenship Amendment Bill (CAB) in Gauhati, India, Tuesday, Dec. 10, 2019. (AP Photo/Anupam Nath)

Meanwhile, in the northeast, violent protesters angry at the legislation took to the streets for a different reason. They fear they will be “overrun” by non-Muslim migrants from neighboring Bangladesh, and that the influx will dilute the culture and political power of indigenous tribal people in that region. Protesters burned tires and blocked main roads and railway lines for the second day on Wednesday.

The army has been deployed to the state of Tripura. A curfew was declared and internet and mobile services blocked in a number of districts to prevent further violence.

The U.S. Commission on International Religious Freedom criticized the bill as going against “India’s rich history of secular pluralism and the Indian constitution.”

A spokesman for the External Affairs Ministry, Raveesh Kumar, slammed the U.S. commission’s statement as “neither accurate nor warranted," according to The Guardian.

CLICK HERE FOR THE FOX NEWS APP 

“The bill provides expedited consideration for Indian citizenship to persecuted religious minorities already in India from certain contiguous countries. It seeks to address their current difficulties and meet their basic human rights,” Kumar said in a statement. “Such an initiative should be welcomed not criticised by those who are genuinely committed to religious freedom.”