Qatar has released eight former officers of the Indian navy after dropping their death sentences, India's foreign ministry said on Monday, crediting the Qatari emir for the decision more than 18 months after the arrest challenged diplomatic ties.

The men were accused of spying for Israel, according to sources, though India and Qatar did not confirm the charges against them. Their death sentence, handed down in October, was dropped in December.

Indian Prime Minister Narendra Modi, who "personally supervised all developments" in the case, will visit Qatar on Feb. 14 and hold talks with its ruler, Sheikh Tamim bin Hamad Al Thani, India's foreign secretary told reporters.

India said seven of the men had returned to the country and authorities were making efforts to bring back the eighth citizen. Some of the men told local media on arrival in New Delhi that it was Modi's intervention that helped free them.

"It wouldn't have been possible without his personal intervention and his equation with Qatar," one of the men told ANI. None of the men were named.

New Delhi engaged in talks for months with Qatar after the men were arrested in August 2022 and the case challenged ties with Doha, a crucial natural gas supplier to India, which is one of the world's top energy importers.

The men, employed by a private company, were supporting a number of programs and activities for the Qatari Navy, a person with knowledge of the case said.

The news of the release comes days after Qatari and Indian firms signed their biggest single deal for supplies of liquefied natural gas and after Modi met Sheikh Tamim on the sidelines of the COP28 climate summit in Dubai in December and discussed the "well-being of the Indian community in Qatar".

More than 800,000 Indian citizens live and work in Qatar. (Reporting by Krishn Kaushik and Shivam Patel in New Delhi, and Shivani Tanna in Bengaluru; Editing by Sonali Paul and Lincoln Feast and Miral Fahmy)