GUWAHATI, India — In less than a week, millions of people in India will find out whether they remain citizens of the country, with the culmination of a byzantine process that critics say could be the world’s largest exercise in forced statelessness.

Over the past four years, a state in northeastern India has subjected its 31 million residents to an exacting citizenship test aimed at identifying immigrants in the country illegally, primarily from neighboring Bangladesh. People had to produce ancestral documents dating back decades and prove links to their parents.

No one knows what will happen to the millions who are left off the final list, known as the National Register of Citizens, which is expected to be published on Saturday. It is known that authorities are setting up detention centers and tribunals, sparking fears of arrest, incarceration or deportation. Families worry about being separated or becoming disenfranchised, unable to vote or access public services.

An earlier, provisional version of the citizenship list for the state of Assam excluded 4.1 million people — a population equivalent to the entire state of Oregon. Human rights groups say the exercise has proved impossible for many people to navigate, particularly the poor and uneducated. 

Omela Khatun, a 45-year-old resident of Darrang district, said she was born in India but has battled to prove it to quasi-legal tribunals for the past seven years. Now concern about her future keeps her awake at night.

“I’m very scared,” she said. “I have heard they will send people to Bangladesh. I can’t read or write. How will I manage without my family?”

Many of those who have had difficulty proving their citizenship in Assam are Muslims who emigrated from Bangladesh. Others have been living in India for multiple generations.

They are an attractive political target for India’s Bharatiya Janata Party, led by Prime Minister Narendra Modi. Modi and his party won a stunning reelection victory in May that critics and supporters say has paved the way for the BJP to implement an agenda that emphasizes Hindu primacy in India.

The ruling party has engaged in increasingly strident anti-immigrant rhetoric. Amit Shah, the country’s powerful interior minister, called such migrants “termites” who would be thrown out one by one. Shah has announced that he intends to take the citizenship exercise nationwide, portraying it as a matter of national security. 

Harsh Mander, a human rights activist and author, said the process of identifying migrants who may have entered the country illegally has become “a tool for targeting Muslims.” He said his greatest concern is a lack of clarity from the government. “Are you going to put millions of people in detention? Will there be concentration camps? Or are you going to throw them in the sea?” 

International rights groups and the United Nations have raised concerns about the consequences of the exercise on vulnerable minorities, including “statelessness, prolonged detention and forced return to countries they have never lived in the past.”

India’s interior ministry did not respond to multiple requests for comment.

Assam shares a porous border with Bangladesh and has recorded several waves of migration, first under colonial rule, then during the partition of British India in 1947, and next in 1971, after Bangladesh won independence from Pakistan.

The state has long witnessed tensions between Assamese speakers and Bengali-speaking migrants, who locals fear will alter the language and culture of the state. In 1985, the government defined citizens as those who could show proof of being in India before March 24, 1971, or their descendants.

The drive to weed out undocumented immigrants has swept up even military veterans. For 30 years, Mohammad Sanaullah served in the Indian army, with stints in grueling border areas. But today, three years after his retirement, he stands accused of being a foreigner.

On May 29, Sanaullah, 52, was arrested and held in a squalid detention center. That night, he said, he cried for the first time in his adult life. 

“I risked my life for the country,” he said, standing outside his home in Guwahati, Assam’s largest city. “What more do I have to do to prove my loyalty?”

The uncertainty of what comes next terrifies him. It is not only Sanaullah who faces an unknown future, but his three adult children, too. If he is left off the citizenship registry, his children will be excluded automatically.

“I’m worried that when my children apply for government jobs or exams, they will be denied opportunities,” he said. “Nobody knows what will happen next. That is the biggest source of tension.”

Those who fail to make it onto the list can appeal to quasi-judicial bodies known as foreigners’ tribunals, like the one that declared Sanaullah a foreigner. The government is setting up 1,000 more such tribunals ahead of the publication of the list. 

At the Saha household in Kharupetia, about 55 miles outside the state capital of Guwahati, there are similar worries. Pradeep Saha, 53, a shopkeeper, and his two sons were left off the draft citizenship list even though his brother’s family was included. The brothers said they submitted identical documents to verify their citizenship.

For more than six months, Saha visited multiple administrative offices, the local foreigners’ tribunal and the police, clutching the same set of yellowed documents carefully laminated, photocopied more times than he can remember. In the last round of filing the family’s claim, Saha’s son Chiranjit recalled one officer telling them the outcome was now up to chance. “This is nothing but unnecessary harassment of genuine citizens,” the son said.

After going through several iterations, the process of making a citizenship list has become “extremely complex,” said Sanjoy Hazarika, the international director of the Commonwealth Human Rights Initiative and a noted Assamese writer. “While there is agreement that we should have the list, there shouldn’t be collateral damage. The process shouldn’t inflict more harm than good.”

Unlike Sanaullah and Khatun, the Sahas are Hindu. They are hopeful that the Modi government will come to their rescue. A proposed federal law would provide citizenship to immigrants in the country illegally who are Hindus or other religious minorities from India’s Muslim-majority neighbors Pakistan, Afghanistan and Bangladesh, deeming them refugees. But conspicuously absent are two neighboring countries in which Muslims are the minority facing persecution — Myanmar and Sri Lanka. Experts say providing citizenship on the basis of religion violates the Indian Constitution.

Khatun, the woman from Darrang, is inconsolable. She won an initial victory in a foreigners’ tribunal in 2015 that established she was an Indian citizen. But her name was not on the provisional registry of citizens. In 2018, for a second time, she was asked to prove her citizenship before the same tribunal. After presenting the same documents, she was declared a foreigner.

“How is this fair?” Khatun asked as she wiped her tears in a recent interview. Her relatives were trying to mortgage their farmland to pay for an appeal.

Bangladesh, for its part, has made clear that it will not accept those left off Assam’s list as returning citizens. One of the most densely populated countries in the world, Bangladesh is already struggling to manage refugees from Myanmar.

“The people that have been there for 75 years, they are [India’s] citizens, not ours,” A.K. Abdul Momen, the foreign minister of Bangladesh, said in a television interview in July.

For people like Sanaullah, the outsider label is an affront. “I’m an Indian and will remain one,” he said on the day he was released from the detention center.

There is only one consolation. “I have served the country. No one can take that away from me.”

Joanna Slater in New Delhi contributed to this report.