Indian Prime Minister Narendra Modi pledged Wednesday to work closely with Donald Trump after the new US president invited him to Washington, looking to ensure an upturn in ties survives a change at the White House.

After their first phone call since Trump's inauguration, the leaders of the world's two largest democracies both indicated they had had a warm conversation and extended mutual invitations to their respective capitals.

But while both leaders share similar backgrounds as establishment outsiders, analysts say their two governments could clash on issues such as trade and visas for Indians wanting to work in the United States.

Statements issued after Tuesday night's phone call indicated both men are keen to build on the recent improvement in ties that began under Trump's predecessor Barack Obama.

Writing on Twitter, Modi said he "had a warm conversation" with the new US president and they had "agreed to work closely in the coming days to further strengthen our bilateral ties".

"Have also invited President Trump to visit India," Modi added after the White House revealed Washington had extended a similar invitation.

Modi, a Hindu nationalist, was effectively barred from the United States for years after deadly communal riots in the western state of Gujarat during his time as chief minister. Most of those killed were Muslims.

But after his landslide election victory, Modi built a strong rapport with Obama who became the first sitting US president to pay a second visit to India during the 2015 Republic Day celebrations.

- 'True friend' -

A surprisingly convivial conversation in November between Trump and Pakistan's Prime Minister Nawaz Sharif caused alarm within Modi's administration which has been portraying its rival regime in Islamabad as the "mothership of terrorism".

But during the call, Trump emphasised the United States "considers India a true friend and partner in addressing challenges around the world," according to a White House readout of the call.

Story continues

"The two discussed opportunities to strengthen the partnership between the United States and India in broad areas such as the economy and defense.

"President Trump looked forward to hosting Prime Minister Modi in the United States later this year."

Several commentators have argued that Modi and Trump should have a natural affinity as political outsiders who have risen to power in part by castigating the traditional ruling elite on a nationalist platform.

Trump's chief strategist Steve Bannon described Modi's victory in India's 2014 general election as the first phase in a "global revolt" against the existing order that culminated with Trump's victory in November.

But in a speech last week, Modi castigated "rising parochial and protectionist attitudes" which was interpreted as a dig at Trump who has vowed to put "America first" as his governing mantra.

Modi's flagship "Make In India" policy is designed to fire up his country's manufacturing sector and ramp up exports, a goal that appears at odds with Trump's protectionist instincts.

Major US firms such as Walmart and Apple have in turn grown frustrated by the regulations and tariffs imposed by Indian authorities as they seek to crack what is a potentially massive market.

Rajrishi Singhal, a Mumbai-based geopolitical analyst, said other potential problem areas included Trump's reservations over an existing visa scheme allowing high-skilled foreign workers into the US.

"There are also issues with the pharma industry -- the US thinks our patent regime is too lenient -- and the US wants access to the Indian agriculture market," he told AFP.

"These issues have been on the boil for the last few years. It won't result in a trade war right away as the leaders will gauge each other first. Later, maybe a year down the line, we will have to see."

During his election campaign, Trump courted Indian-American voters and even released a campaign advertisement in Hindi for Diwali, the Hindu festival of lights -- albeit in a thick US accent.

The new president's hardline rhetoric towards Muslims during his campaign found favour in some quarters in India, which has had its fair share of tensions between the majority Hindu population and its Muslim minority.

Paranjoy Guha Thakurta, editor of India's Economic and Political Weekly, said there were "uncanny similarities" between Modi and Trump who both "have scant regard for the minorities and the media".

"They are two highly polarising figures," he added.