Photo/IllutrationIn this photo released by the India Government Press Information Bureau, Indian Prime Minister Narendra Modi, left and Maldives President Ibrahim Mohamed Solih sit during their meeting in Maldives, June 8, 2019. (India Government Press Information Bureau via AP)

MALE, Maldives-- Indian Prime Minister Narendra Modi arrived in the Maldives on Saturday on his first official overseas trip since being elected to a second term.

It's the first visit by an Indian prime minister to the South Asian archipelago nation in eight years.

Modi met with Maldivian President Ibrahim Mohamed Solih on Saturday evening and later addressed the Maldives' Parliament.

"The two leaders reiterated their strong commitment to further strengthening and invigorating the traditionally strong and friendly relations between India and the Maldives, nurtured by geographical contiguity, ethnic, historical, socio-economic and cultural ties between the peoples of the two countries," said a joint statement from the two leaders after talks.

"President Solih reaffirmed his government's 'India-First Policy' and pledged his government's full support towards deepening the multifaceted, mutually beneficial partnership between India and the Maldives," the statement said.

Solih's stand is a marked shift from his predecessor Yameen Abdul Gayoom who followed a pro-China policy.

Several agreements were also signed between the two countries covering health, cargo and passenger transportation by sea, customs services and others.

India had been concerned with Yameen's leaning toward China, which is seeking more influence in the Indian Ocean region. Yameen had pledged support to China's "Belt and Road" initiative and China invested in many infrastructure projects in the Maldives.

Addressing the Maldives' Parliament, Modi said terrorism was the biggest threat facing the world and there could be no distinction between the so-called "good" and "bad" terrorists.

"State sponsorship of terrorism is the biggest threat today. It is time for a global conference on terrorism," he said.

He also underscored the importance of the Indo-Pacific region. "It has been our lifeline, and also the highway for trade and prosperity."

The two countries agreed to strengthen coordination in enhancing maritime security in the Indian Ocean region "through coordinated patrolling and aerial surveillance, exchange of information, and capacity building," the statement said.

They agreed to set up a joint working group on counter-terrorism, countering violent extremism and de-radicalization, it added.

India and the Maldives also highlighted the importance of combatting the impact of climate change, especially detrimental to developing countries, including small island developing states such as the Maldives through the United Nations Framework Convention on Climate Change and the Paris Agreement.

Modi will travel to Sri Lanka, another of India's neighbors, on Sunday for a one-day visit to the island nation. His choice of the Maldives and Sri Lanka for his first overseas trip since being re-elected this spring "underlines the continued emphasis that the government lays on the 'neighborhood first' policy," Indian Foreign Secretary Vijay Gokhale said ahead of Modi's trip.

Since first becoming prime minister in 2014, Modi has stressed a "neighborhood first" policy for the South Asian region, promising neighbors prioritized benefits of India's economic growth.

The Maldives mended ties with India with Solih's election as president last year. Solih's first overseas trip was to India, and since then, several Maldivian ministers have visited India for bilateral talks.