Prime Minister Narendra Modi won a second term in office after responding to a suicide attack on Indian paramilitary forces in Kashmir with an airstrike inside Pakistan, allowing him to turn voters' attention away from the country's highest unemployment rate in decades.
Now, after his swearing-in on Thursday, he will need to deftly navigate a trade war between the United States and China and rising tensions between the US and Iran, an important source of cheap oil for India's fast-growing economy. Modi will also face pressure to protect India's traditional sphere of influence in South Asia.
Many Modi supporters credit the 68-year-old leader of Bharatiya Janata Party with India's growing status abroad, and messages from US President Donald Trump, Chinese President Xi Jinping, Russian President Vladimir Putin and Israeli Prime Minister Benjamin Netanyahu congratulating him on his party's victory even before all results were in seemed to bolster that belief.
Lalit Mansingh, a former Indian ambassador to Washington, said the foreign policy has been one of Modi's most pronounced achievements, as he pursued it with vigor "that we have not seen in any other prime minister so far."
As Modi returns to power for another five years, global leaders are looking to India to take on a larger burden of responsibility in the world, acting as a security buffer in the Indo-Pacific, opening its markets and responding to climate change, even though Modi struggled to manage many of India's domestic issues in his first term.
"Maneuvering in the current international situation will be quite a challenge for Modi," said Dilip Sinha, a retired Indian diplomat.
The US wants India to act as a counterweight to Beijing to prevent the rise of Chinese hegemony in Asia, but it also wants the Modi administration to lower barriers to trade.
US Commerce Secretary Wilbur Ross complained to leaders in New Delhi earlier this month that American companies struggle to access India's markets because of tariffs and myriad regulations. To help reduce the trade imbalance, India has signed more than $15 billion in US defense contracts.
According to the World Economic Forum, India is poised to become the world's third-largest consumer market, growing from $1.5 trillion this year to $6 trillion by 2030.
At the same time, with the Trump administration scaling up sanctions on Iran and ending waivers for countries including India that import Iranian goods, India must replace its third-largest source of imported oil.
The fear of a further conflagration in the Gulf region could make oil more expensive and threatens the security of 7 million Indians working as migrant laborers. "It's an extremely difficult and challenging position for India," Sinha said.
During the Cold War, India didn't have open relations with Israel, leaning heavily in favor of the Palestinians. But over the last 25 years, ties between the two countries have warmed.
Trade between them has skyrocketed from $200 million in 1992, when India and Israel established diplomatic ties, to $4.16 billion in 2016. The growing ties risk upsetting India's longstanding relationship with other Middle Eastern countries.
The US weapons purchase agreements, coupled with Russia's improving ties with Pakistan and China, also pose a challenge to Russia-India relations, which date back to the Cold War.
"India's Russian ties are also beginning to fray. The recent fighter aircraft deals with France and other military hardware purchases from the USA have resulted in sidelining India's usual defense partner," the opposition Indian National Congress party said in a statement.
India faces perhaps its biggest challenge with China at its northeastern border, as Beijing invests billions in infrastructure development in South Asia.
India takes years to execute projects, whereas China delivers quickly on what it promises. India needs to maintain close ties with Sri Lanka, Bangladesh, Bhutan, Nepal and the Maldives, its traditional sphere of influence. But delays by Indian companies have led to cost overruns, prompting India's neighbors to look toward China for speedy development.
Modi has carefully cultivated ties with President Xi after a 2017 border standoff over the Chinese construction of a road in Doklam near a tri-border area with Bhutan. India and China fought a bloody war in 1962 over a border dispute that continues to simmer.
But their relations have thawed recently, with Beijing deciding against blocking the UN designation of Masood Azhar, the leader of the Pakistan-based militant group that claimed responsibility for the February suicide bombing in Kashmir, as a global terrorist.
Though Modi invited then-Pakistan Prime Minister Nawaz Sharif and other South Asian leaders to attend his swearing-in ceremony in 2014, the neighbors were at the brink of nuclear war in February. Modi has refused an official dialogue with Islamabad until it ends support for what India calls terrorism emanating from its territory.
Some in Kashmir, which bears the brunt of Pakistan-sponsored terrorism, see Modi's win as "a blessing in disguise," saying his tough approach could energise the movement for self-determination in the region."The fog around India's policies on Kashmir is increasingly getting removed thanks to Modi and Co.," said Sajjad Ahmed, a schoolteacher.