Indian Prime Minister Narendra Modi on Thursday committed to strengthening ties with Qatar during his first visit to the gas-rich Gulf emirate since 2016.

During a meeting with Qatar's ruler, Modi gave a "commitment to further expanding and deepening bilateral cooperation with Qatar", a statement from India's foreign ministry said.

The premier also thanked Sheikh Tamim bin Hamad Al-Thani for hosting the 800,000-strong Indian community in the tiny Gulf state.

The visit follows the release earlier this month of eight Indian ex-navy personnel arrested by Qatar and sentenced to death, according to India's foreign ministry.

New Delhi never gave details of the eight Indian nationals or their alleged crimes, and Qatar has not made the charges public.

But Indian media reported the men -- among them former high-ranking and decorated officers, including captains who once commanded warships -- were arrested in Doha in August 2022 for spying for Israel.

In a rare public statement on the case as it was under examination in October, Qatar said it had full confidence in the independence and integrity of its judiciary.

The freeing of the former sailors has been presented as a significant diplomatic victory for Modi in the Indian press.

The announcement came of the heels of a major liquified natural gas deal between India and Qatar's state-owned hydrocarbon giants Petronet and QatarEnergy.

Under the agreement, the Gulf state will supply energy-hungry India with 7.5 million tonnes of LNG per year for the next 20 years.

The Indian foreign ministry said during Modi's meeting with the emir the pair discussed "economic cooperation, investments, energy partnership", as well as cultural bonds.

Political expert Michael Kugelman told AFP the visit by Modi solidified at reset in relations between India and Qatar.

"I would certainly view Modi's visit to Doha as a reflection of a new phase of a relationship that New Delhi would like strengthen," he said.

"I think that it would not have been possible to enter that new phase until this issue of the ex-sailors had been resolved. I think that created an opening for Modi to initiate this new phase," the South Asia director for the US-based Wilson Center added.