Mohammed Sana Ullah is currently serving as a deputy inspector in the border wing of the Assam Police. (Photo: Twitter)

Police in Assam detained a Kargil war veteran and serving police officer on Wednesday after a court declared him a foreigner, in one of the most controversial outcomes of India’s effort to clamp down on illegal immigration from neighbouring Bangladesh.

Millions of people in Assam are scrambling to prove their citizenship after the government, led by Prime Minister Narendra Modi’s party, mandated residents of Assam to produce documents proving that they or their families lived in the country before March 24, 1971.

Police said they sent Mohammed Sana Ullah, 52, to a detention centre in Assam based on the order of a Foreigners’ Tribunal.

"He served the Indian army for 30 years but was declared as a foreigner ... and as per prescribed norms we have sent him to the detention camp," Mousumi Kalita, a senior police official in Assam, told journalists.

"We only abide by the tribunal’s order and not aware on what grounds or why he was declared a foreigner."

Mohammed Sana Ullah’s lawyer said it was a case of mistaken identity as the order cited his client as a labourer who came to India after 1971 without legal documents. Ullah’s family said they had Assam land records going back to 1935.

Lawyer Aman Wadud, who has handled dozens of cases of illegal immigration in Assam, said he would challenge the order in a higher court on Thursday.

SPECIAL REPORT | The nowhere people: Assam and the citizenship register

Speaking to Reuters as he was shoved inside a police vehicle on the way to the detention centre in the border town of Goalpara, Ullah said he was heartbroken.

"This is the reward I got after serving for 30 years in the Indian army," said Mohammed Sana Ullah, currently a deputy inspector in the border wing of the Assam Police. "I am an Indian, very much an Indian and will forever remain an Indian."

Much of the over 2,500-mile-long (4,000-km) border between Hindu-majority India and mainly Muslim Bangladesh is porous. Hundreds of thousands of people have moved to India from Bangladesh since its New Delhi-backed war of independence from Pakistan in 1971.

The BJP, which increased its parliamentary majority this month after a general election, has promised to identify all migrants living in the country illegally, give citizenship to all non-Muslims from neighbouring Muslim majority countries such as Bangladesh and Pakistan, and expel the rest.

Bharatiya Janata Party made electoral gains in Assam and neighbouring West Bengal state by pledging to act against immigrants, accused by some locals of taking jobs and resources.