Its incumbent president, Yameen Abdul Gayoom, courted large loans and investments from China and Saudi Arabia to the displeasure of such nations as India and the United States. At the same time, he grew increasingly autocratic, cracking down on dissent and undermining parliament.

AD

Yameen’s opponent, a veteran lawmaker named Ibrahim Mohamed Solih from the Maldivian Democratic Party, declared victory in a news conference on Sunday. Solih represented a coalition of four opposition parties whose leaders are either in detention or in exile.

AD

“This is the first successful step on the road to justice,” Solih told reporters, calling on the president to immediately begin an orderly transition of power. “We achieved this because of the hard work of Maldivians.”

He received 58 percent of the votes cast, according to provisional results tallied by local news media, with official results yet to be announced.

Home to 400,000 people, the Maldives is a small country with outsize significance. Its location makes it a prize for powers such as China and India that are seeking to extend their influence in the Indian Ocean, through whose waters pass much of the world’s commerce.

AD

The picturesque islands are also facing an existential threat from climate change. A different kind of peril comes from Islamic extremist groups, which have recruited men from the Maldives, a predominantly Muslim nation, to join their ranks in Syria and Iraq.

AD

The country’s experiment with democracy is only a decade old: In 2008, Mohamed Nasheed became the country’s first democratically elected leader after three decades of dictatorship.

A former pro-democracy activist, Nasheed once memorably held a cabinet meeting underwater to highlight the danger of rising sea levels, but he was forced to resign under murky circumstances and later fled into exile.

AD

Before Sunday’s vote, many in the Maldives worried that the result would be rigged in favor of Yameen, the incumbent.

In the months leading up to the election, international observers said Yameen had worked to stifle opposition to his candidacy by intimidating and imprisoning critics under broad counterterrorism and anti-defamation laws. Yameen has defended such moves as necessary for national security.

AD

In February, Yameen declared a state of emergency and arrested two supreme court judges as well as a former president — his half brother — who had joined the opposition. Later, he installed a close ally to head the country’s election commission.

AD

The vote unfolded in an environment of “massive mistrust,” said Mariyam Shiuna, executive director of Transparency Maldives, an anti-corruption group. “No losing party would be willing to accept the results.”

Early indications, however, were that the ruling party would abide by the election outcome. But Shiuna noted that the supreme court has in the past annulled a presidential election result, so the next several days will be critical.

Ahmed Nihan, a member of parliament for the ruling Progressive Party of Maldives, wrote on Twitter as the results came in that his party “will have the courage to accept the decision of the Maldivian people, win or lose.”

AD

AD

On Sunday, voters stood in line for hours to cast their votes in the highly charged election. Some complained the process was marred by a lack of organization and preparation.

“There is this feeling that all this is intentional,” said Ahmed Afrah Ismail, 26, an engineer who voted in the densely populated capital of Male and said he saw people abandon their spot in line out of frustration.

Aminath Juman, 18, voted for the first time Sunday and said she was worried about protests in the aftermath of the polls, regardless of who the winner was. “We should all be prepared,” she said.

Under Yameen’s government, the Maldives drew closer to China and Saudi Arabia. Last year, China and the Maldives signed a free-trade agreement, a first for the Maldives; China has also loaned money to overhaul the international airport and financed the construction of a bridge.

AD

AD

Opposition leader Nasheed — who lives in exile in Sri Lanka — wrote this year that “piece by piece, island by island, the Maldives is being sold off to China.”

Corruption also flourished under the Yameen government. The former tourism minister reportedly leased out more than 50 islands and lagoons to developers in 2014 and 2015 without public bidding as required by law. By contrast, only 100 resorts were built in the prior four decades.

Yameen has posed a challenge for India and Western nations. In July, the European Union threatened to impose sanctions on Maldivian officials responsible for “serious human rights violations” or “undermining the rule of law.” Earlier, the Maldives withdrew from the Commonwealth, an association of former British colonies, after the organization criticized the Yameen government for eroding democratic freedoms.

AD

AD

India in particular has struggled with how to respond to the slide toward authoritarianism in the Maldives. Last month an Indian member of parliament further inflamed matters by stating on Twitter that India should “invade” if the elections were rigged , forcing India’s government to publicly disavow such a course of action.