India may not have assembled the biggest crowd in world history for last week’s visit by Donald Trump; it was several noughts short of the 10 million he anticipated. But there aren’t many democratic countries where he faces virtually no hostility and much goodwill.

With the Democrats bracing themselves for Super Tuesday, and struggling to offer coherent, plausible alternative for the November elections, the Indian trip could be Trump’s audition to be a respected international statesman: a new role for his second term.

He sailed through his itinerary – Namaste (welcome) Trump Rally, with over 100,000 cheering attendees; the romantic setting with Melania at the Taj Mahal; operating Mahatma Gandhi’s spinning wheel; starring at a banquet for politicos and plutocrats – with all the aplomb of a master diplomat.

I happen to be on a family visit to India. I was in the south and couldn’t claim to have got within 1000 miles of Potus, Flotus, or the rest of the American royals, among which Ivanka and Jared were especially prominent. But I caught enough of the ‘visuals’ to see that the visit achieved what he and his Indian host, Narendra Modi, wanted: lavish compliments all round; the promise of eternal love between the United States and India; reaffirmation of an important political alliance whose importance is insufficiently appreciated in the West. Crucially, there was no mention of the concurrent riot – leaving dozens dead – over a new citizenship law, which disadvantages Muslims.

It is intriguing that Trump – who is despised by swathes of Europe, by intellectuals across the globe and by approaching half of the American public, as a crass, pompous, bullying, bigoted narcissist – is liked and respected in the world’s largest democracy. A Pew survey – a respected measure of opinion in different countries – shows a steadily rising proportion of Indians, now 56 per cent, see Trump as a force for good.

India’s equally controversial prime minister, Modi, has enthusiastically embraced Trump, and taken a (reasonable) gamble that Potus will be re-elected. As an emerging superpower, India, like the United States, sees China as a competitor and a threat. India’s hostility is accentuated by China’s close links to Pakistan. And Trump’s diatribes against Muslims have played well with the base of Modi’s Hindu nationalist BJP. As it happens, Trump’s rally speech was a model of tact and he urged religious tolerance. But his prejudices are sufficiently well known that Indians can feel “he’s thinking what we’re thinking”.

The connection to Trump is based on more than shared prejudices and strategic interests. India has a young, digitally literate population who can relate to his mastery of social media. Many Indians among 72 million Twitter followers will appreciate the direct hard hitting punchlines. The idea of English as a universal language is now given expression in Trump’s tweets rather than in Shakespeare. A smart member of the Trump entourage also hit on the idea of Hindi tweets, which were followed up by a video portraying Trump as a mythical Hindu warrior. The clip has gone viral.

The visit also saw plenty of transactional Trump. He arrived already having slapped tariffs on Indian products, and demanded liberalisation of India’s protectionist trade regime. One of the many irritants was an Indian ban on US dairy products, on account of the animal-derived blood meal fed to Indian cows: the Indian equivalent of European antipathy to beef hormones and chlorinated chicken. The stick was followed by the carrot, of a promised ‘very, very major’ trade deal, which is one more ‘very’ than Boris Johnson has been promised. India wants more high skilled visas in the US. The US has a potential pipeline of £10bn worth of contracts to sell arms to India, for drones, missiles, helicopters and much else. "America First" and "India First" have a lot to trade.

Trump is also looking for a political dividend. In the world of US identity politics, he needs supporters beyond the white working class, Christian fundamentalists, and the Republican country clubs. America’s rapidly growing proportion of Indian-Americans – currently 2.65m Indians – sent 84 per cent of their vote to Hillary Clinton in 2016. That is being squeezed hard with Modi’s help. Boris Johnson has spotted the same opening in the political market here.

Meanwhile, the jamboree in Ahmedabad has provided a helpful distraction from Trump’s other south Asian business, namely his abject surrender to the Taliban. The latter have kindly promised not to escalate violence, so that Trump can pull out US troops from Afghanistan, hopefully before the November election. America thus follows Britain and Russia, on to the list of great powers, defeated by Afghan tribesman. But being Trump this retreat is being spun as a stunning political and military triumph: peace in our time.

The India visit also tells us quite a lot about modern India, and why it dovetails so comfortably with Trump’s America. Long gone are the days of secular values, socialist planning and non-alignment. The villages I first visited half a century ago are now small towns, throbbing with energy; congested with motorcycles, mopeds and cars; with businesses sprouting everywhere; and houses renovated on the back of wages from the new factories, or from remittances overseas. For the rapidly expanding middle class, there is the prospect of Western lifestyles: the American dream spliced with Indian culture and religion.

What we call progressive politics has almost disappeared from India. The once dominant Congress Party is a pale shadow of its former self. Its leaders boycotted a Trump dinner, not because they disapprove of the president, but as a petty retort to the absence of an invitation for party chief and matriarch of the Gandhi family, Sonia Gandhi.