MUMBAI, India — Underscoring its desire for stronger ties to India and the country’s 1.3 billion people, Saudi Arabia’s state-owned oil giant is buying 20 percent of the petroleum-related businesses of Reliance Industries, one of India’s biggest companies.

The $15 billion investment, which Reliance announced on Monday, is a vote of confidence by the Saudis in India’s economy and its prime minister, Narendra Modi, at a time when India’s economy is flagging. Mr. Modi has recently stepped up his efforts to court the Saudis and other overseas investors as the flow of foreign money into India has declined and the country’s trade relationship with the Trump administration has deteriorated.

Saudi Arabia’s closer embrace of India also deals a blow to Pakistan, which has been trying unsuccessfully to rally support among fellow Muslim nations to oppose Mr. Modi’s decision last week to revoke the statehood and semiautonomous status of Jammu and Kashmir, India’s only Muslim-majority state. The region has been fought over by Pakistan and India since they both gained independence from Britain in 1947, and each country occupies portions of it.

Saudi Arabia and Pakistan have long been close, with the Arab nation often supporting its South Asian neighbor in disputes with India. During a February visit, Saudi Arabia’s crown prince, Mohammed bin Salman, promised to invest $20 billion in Pakistan, offering its government a crucial lifeline as it copes with an economic crisis.