Until a few months ago, the U.S. government was effectively boycotting Narendra Modi, the man who is virtually certain to be India's next prime minister following the landslide victory by his party in the country's parliamentary elections.

So will the U.S. now warm to Modi as the elected leader of the world's largest democracy?

Before answering that, let's look at why Washington refused to deal with him.

The Americans, along with other Western governments, turned their back on Modi after widespread rioting in 2002 in Gujarat state, where he had become chief minister a year earlier.

The trouble began when some 60 Hindu pilgrims were killed in a train fire blamed on Muslims. Hindus then went on a rampage, killing more than 1,000 people in revenge, mostly Muslims.

Critics accused Modi, a Hindu nationalist, of not doing enough to stop the carnage, if not worse. Politicians close to him were convicted of involvement, including one of his Cabinet ministers who was sentenced to 28 years in prison.

Modi has always denied any wrongdoing, and subsequent investigations did not implicate him. However, human rights groups criticized those inquiries and Western governments kept their distance.

During President George W. Bush's administration, the U.S. went so far as to deny Modi a visa in 2005 on the grounds of "severe violations of religious freedom."

Modi did address the riots in a blog post last December.

"I was shaken to the core," he wrote. He did not offer an apology, which many victims and their relatives had sought.

But as it became increasingly likely that Modi's Bharatiya Janata Party would win the election, Western countries reversed course and began reaching out.

The U.S. ambassador to India, Nancy Powell, traveled to Gujarat's capital, Gandhinagar, and held talks with Modi at his residence in February, which effectively ended the boycott. European countries also re-established contact.

And with the election victory, any doubts about Modi's political standing in Washington quickly evaporated. Just hours after the results were announced, President Obama called Modi, congratulating him and inviting him to Washington.

Foreign affairs commentator Fareed Zakaria called the U.S. ostracism of Modi "selective, arbitrary and excessive." In addition, Zakaria said the two countries needed a closer partnership, particularly at a time when Obama is calling for the U.S. to pivot to Asia. Zakaria wrote:

"If the United States and India, the world's oldest and largest democracies, could create a genuine partnership, it would be good for Asian stability, for global prosperity, and, most especially, for the cause of democracy and human rights around the world."

To cite just a few key issues, the U.S. and India are both concerned about the instability in Afghanistan and Pakistan and are also keeping close watch on China's growing clout in Asia.

While Modi, 63, was unwelcome in the West until recently, he has been a regular visitor to China. His pro-business agenda has included encouraging Chinese investment in Gujarat, a western coastal state that also borders Pakistan.

His election campaign stressed the economic development in the state, which has seen unprecedented growth since he took over in 2001. However, critics say that powerful businessmen have been the big winners and that many of the poor have seen few benefits.

Modi, the son of a train station tea vendor, will have a strong mandate after such an overwhelming electoral win. It appeared his BJP would have an outright majority in Parliament and would not be required to find coalition partners. This would mark the first time in three decades that one Indian party has so dominated an election.

Modi should also push for a larger Indian role in regional affairs, according to Zakaria.

"New Delhi's ruling elites remain ambivalent about the kind of foreign policy they should conduct, trapped between their old, Third World, anti-colonial impulses and the obvious requirements of a new Asia in which China is emerging as the dominant power," he wrote. "The result is that India has shied away from the kind of robust relationship with the United States that would help it economically, militarily and politically."

Copyright 2016 NPR. To see more, visit http://www.npr.org/.