Whoever scheduled Prime Minister Narendra Modi’s first visit in 14 years to the U.S. did a splendid job of keeping his public events at the start before his formal meeting with President Barack Obama. The result was that Modi got a rock star reception in New York for three days that swept him on a wave of popularity to Washington to begin the serious work of repairing the Indo-US bilateral ties that have languished for the past 4 years.

Obama could not have not noticed the buzz that the prime minister created. Modi met a dozen senior U.S. business leaders for a breakfast meeting, then met six of them one-to-one, he shared the stage with Hugh Jackman at a youth climate concert in Central Park, and then spoke to a sold out crowd at Madison Square Garden.

So when Modi finally showed up at the White House for dinner with the U.S. president on Monday, Obama was left in no doubt that he was meeting the leader of the world’s largest democracy, a man who till four months ago was barred from entering the U.S. for the anti-Muslim riots that took place in Gujarat in 2002 when Modi was chief minister.

The challenge for both leaders is to build trust between the two administrations and revive the flagging bilateral relationship.

In a joint "vision statement" issued after their first meeting on Monday, Obama and Modi said they would work together "not just for the benefit of both our nations, but for the benefit of the world."

The two leaders vowed to expand and deepen their countries' strategic partnership and make it a model for the rest of the world. They said their countries would cooperate on security and to fight terrorism, and would back a "rules based" global order in which India assumes greater multilateral responsibility, including a reformed U.N. Security Council.

Obama and Modi also vowed to work together against the threat posed by climate change and to cooperate to address the consequences of unchecked pollution.

"We have a vision that the United States and India will have a transformative relationship as trusted partners in the 21st century. Our partnership will be a model for the rest of the world," they said in their statement.

The two leaders also said their countries would work to ensure that economic growth brought better livelihoods for all people and stressed the importance of open markets and fair and transparent practices to allow trade to flourish.

According to Reuters, Washington has been keen to expand business and security ties with India, which it sees as a key counterbalance to an increasingly assertive China in Asia. Obama has backed New Delhi's bid to become a permanent member of the U.N. Security Council.

However, the relationship has failed to live up to his declaration in 2010 that it would become "one of the defining partnerships of the 21st Century."

Modi, who came to power in May, has maintained a hectic schedule since arriving in America on Friday, even though he is fasting this week in accordance with Hindu custom and drank only warm water at the White House dinner.

Foreign ministry spokesman Syed Akbaruddin said the dinner meeting was "extremely convivial" and the two leaders found they had a common interest in technology and shared experience in that they were relative political outsiders before coming to power.

He said they agreed they "should focus on some big things they can achieve in a finite time period in the next few years."

As part of an effort to spur foreign investment, Modi told the U.S. corporate leaders he met on Monday that he was committed to liberalizing India's economy, which has underperformed other emerging markets recently.

Modi said he was "committed to a stable tax regime" as this was necessary to encourage investment, according to Akbaruddin.

He said Modi had invited the BlackRock investment management firm to organise a major conference in India early next year to bring in as much as $6 billion in investment.

Caterpillar Chairman and CEO Doug Oberhelman, who attended the breakfast meeting, told Reuters he had been impressed by Modi's determination to revive the Indian economy. "I believed him. He was very serious," he said.

Modi has also used his visit to drum up interest in India among young Americans.

On Saturday, Modi addressed the U.N. General Assembly and then appeared before some 60,000 young people at the Global Citizen Festival and told them, “May the Force be with you”.