The US president, Donald Trump, has delighted a stadium of 125,000 cheering Indians in Gujarat by declaring: “America loves India. America respects India. And America will always be a faithful and loyal friend to the Indian people.” It might seem a discordant note from a president whose rule has been marked by a single-minded obsession with halting foreign immigration. But it’s an obsession he shares with his Indian counterpart, prime minister Narendra Modi, who stood on the stage alongside him.

The president has previously complained about immigration from “shithole countries” and suggested a policy that prefers migrants from “countries such as Norway”. And his administration has assiduously prioritised changes in immigration laws. Trump’s first attorney general, Jeff Sessions, called for a return to something like the 1924 Immigration Act, which banned immigration from Asia and severely restricted the entry of other people considered racially undesirable.

Hitler was influenced by American ideology. His Nuremberg Laws made my father, born in Berlin, a second-class citizen

Stephen Miller, Sessions’ protege and Trump’s longest-serving senior adviser, was recently quoted as describing stopping migrants as “all I care about – this is my life”. Miller drafted one of the first executive orders signed by Trump, “Protecting the Nation from Foreign Terrorist Entry”, which banned immigration from seven Muslim-majority countries; a subsequent version, altered to tone down its too-obvious religious discrimination, has been approved by a 5-4 majority in a supreme court that features two new ultra-conservative Trump appointees. In January six countries, including four from Africa, were added to the list.

In the early 20th century, the US deployed citizenship strategically to exclude non-whites and non-Christians, which impressed Hitler. In Part II of Mein Kampf, he decries the idea of a state in which “race and nationality” play no role in citizenship, proposing a “national state”: “Anything crazier and less thought-out than our present laws of state citizenship is hardly possible to conceive. But there is at least one state in which feeble attempts to achieve a better arrangement are apparent: the United States of America, where they absolutely forbid [the] naturalisation of certain defined races, and thus are making a modest start in the direction of something not unlike the conception of the national state.”

My wife’s great-grandfather Takayuki Yaokawa Sato was a fisherman by trade. At our family gatherings, we show an old American photo of him, with a fishing pole, proudly holding a large fish. Sato, a Japanese immigrant, married Grace Virginia Woods, a US citizen, in the early 20th century, when the country was gripped by fears of a “yellow peril” and the supreme court declared Asians ineligible for naturalisation. In concert with the 1907 Expatriation Act, which revoked citizenship to American women who married non-citizens, this deprived Woods of her citizenship. She only regained it upon her husband’s death.

US immigration policy was a source for Hitler’s “national state” vision. In September 1935, the German government realised this vision with the Nuremberg Laws, which prohibited non-Aryans from marrying those of “German blood” and created a category of second-class citizenship for Jews. Here too, Hitler was influenced by American ideology, in particular the Jim Crow anti-miscegenation laws. At the time, my Jewish father was a German citizen in Berlin, where he had been born in November 1932. On 15 September 1935, he became a second-class citizen.

Stripping minority groups of the state protection associated with full citizenship leaves them vulnerable to brutal treatment. In Hannah Arendt’s phrase from The Origins of Totalitarianism, citizenship is “the right to have rights”. The Nuremberg Laws coincided with the building of large detention centres – concentration camps – for those affected by them. The US Holocaust Museum describes a concentration camp as a zone where the legal norms of arrest and imprisonment do not apply.

The European-American concept of a national state had influence outside Europe. VD Savarkar, the Indian political theorist who ushered in Hindu nationalist ideology, was influenced by European ethno-nationalism. He took the Nazi treatment of German Jews to be a model for eventual Hindutva policy towards India’s Muslim residents. Rashtriya Swayamsevak Sangh is a Hindu nationalist movement dating back to the mid-1920s, many of whose members venerated Savarkar. Senior leaders, such as MS Golwalkar, were influenced by Mussolini and Hitler. The Bharatiya Janata party, the political wing of RSS and now India’s ruling party, has begun to implement changes in citizenship laws that echo the Nuremberg Laws.

India’s new Citizenship Amendment Act allows for a fast-track to citizenship for non-Muslim migrants, thereby discriminating against Muslims. The proposed national register requires residents to prove their citizenship with documentation – which many in India lack. Together, these laws place Muslims without documentation in a quandary. Large detention centres are being built to house India’s Muslim residents who are declared ineligible for citizenship. Like the US immigration policy so admired by Hitler, these laws are a mask: they are designed to privilege Hindus in the citizenship laws of the world’s largest democracy.

Trump leads an administration that seeks to return the US to the national state of Hitler’s adulation. In many respects, Modi’s India is considerably further along this path. The student has become the teacher.

There is more to fascism than changing citizenship laws. Fascist movements seek one-party rule: over the courts, the police, the military and the press. They involve a cult of loyalty to a single leader and nostalgia for a mythic past when the nation was dominated by the privileged group. But the core of fascist ideology is realised in changing citizenship laws to privilege a single ethnic group. This is why we regard the Nuremberg Laws as a defining moment in German history, and the concentration camp as the defining Nazi institution.

History has been rightly horrified by the Nuremberg Laws and their consequences. Why, then, are so many countries going down this path?

Fascism thrives during moments of perceived crisis, which can be represented as a zero-sum battle for group survival. The climate crisis, already taking the form of water wars between Indian states, is an example.

The solution is international agreements, which recognise that we humans share similar fates – that our similarities far outweigh our differences. This liberalism is denounced as “globalism” by figures such as Trump, while liberals and leftists who defend India’s secular constitution are denounced as “anti-national” by the BJP and its acolytes. Trump’s triumphant visit to India demonstrates just how global ethno-nationalism, and its more violent sibling, fascism, has become.

• Jason Stanley is a professor of philosophy at Yale and the author of How Fascism Works