Opposition candidate Ibrahim Mohamed Solih has won the Maldives' presidential election in a surprise defeat of President Abdulla Yameen.

He took 134,616 votes to beat Mr Yameen, who received 96,132, provisional results showed.

Mr Yameen, who has been accused of crushing dissent in the archipelago, admitted defeat, saying he accepted the result.

The Maldives is a key battleground in the rivalry between China and India.

The US and India have welcomed Mr Solih's win. Mr Yameen had drawn the Maldives closer to China, which has stepped up its presence in the Indian Ocean in recent years.

Many opposition politicians in the Maldives have been jailed under Mr Yameen, and the US and European Union had threatened sanctions before the vote if the democratic situation did not improve.

Supporters of Mr Solih took to the streets in celebration overnight.

"The message is loud and clear. The people of Maldives want change, peace and justice," Mr Solih, widely known as Ibu, told reporters in the capital, Male.

In a televised address to the nation on Monday, Mr Yameen said he had congratulated Mr Solih, while defending his record.

President Yameen had been widely expected to win another term in office and some observers had believed the election was rigged in his favour. Voter turnout was 89%,

"No major issues were reported in the vote counting process as well as with the voters list, which will affect the results," the foreign ministry said in a statement.

Outside the main opposition campaign centre in Male, hundreds of people gathered overnight to celebrate, chanting "Ibu, Ibu, Ibu".

Exiled ex-President Mohamed Nasheed, who was ousted by Mr Yameen in 2012, said on Twitter that Mr Solih had done "an extremely good service" to the people of Maldives.

Polls opened at 08:00 (03:00 GMT) on Sunday, and closed three hours later than expected, at 19:00, due to long queues.

What's the situation in the Maldives?
The Maldives is made up of 26 coral atolls and 1,192 islands. More than 400,000 people live there but its future hangs in the balance due to climate change. Tourism is a vital part of its economy.

The archipelago has been gripped by political upheaval in recent years. In February the Supreme Court quashed the convictions of nine opposition figures, among them Mr Nasheed.

But after President Yameen declared a state of emergency and ordered the arrest of two judges, the court reversed its decision.

The move was seen as a sign that Mr Yameen would not tolerate any challenge to his rule and sparked criticism from Washington, London and New Delhi.

Some in India, meanwhile, called for an intervention in a small, neighbouring country once seen as firmly within its sphere of influence. Mr Nasheed also appealed for Indian military intervention.

In a statement after Mr Solih's victory, India's Ministry of External Affairs said Sunday's election marked "not only the triumph of democratic forces in the Maldives but also reflects the firm commitment to the values of democracy and the rule of law".

What role has China played in the Maldives?
As part of Beijing's push to gain strategic influence and carve out new trading routes in the Indian Ocean and beyond, it has lent billions for huge infrastructure projects in Pakistan and Sri Lanka, and operates key ports in those countries, to the chagrin of India.

Under Mr Yameen, the Maldives has also welcomed Chinese money for major projects and signed a free trade agreement. More tourists from China now visit the Maldives than from any other country.

Before the vote, analysts said that Beijing feared any change in government that could affect its interests. India, meanwhile, was seen as preferring the opposition, because of its concerns about Mr Yameen's cosy ties with its regional rival.

Was it a fair election?
Some international monitors, including from the EU and UN, did not send teams to monitor the election, fearing their presence would appear to condone Mr Yameen's re-election. Others said they could not get visas in time.

On Saturday, police officers searched the opposition Maldivian Democratic Party office in Male without a warrant, the party said. A police spokesperson confirmed the raid to the BBC, without providing further details.

Before announcing provisional results, the election commission's chief, Ahmed Shareef, said there were no irregularities that could affect the outcome of the vote, the Maldives Independent newspaper reports.

Mr Yameen has shrugged off accusations of authoritarianism, saying during the campaign: "No-one will come to greet me and shake my hand, if there is tyranny."

His half-brother, Maumoon Abdul Gayoom, ran the country autocratically for three decades until the archipelago's first-ever democratic vote in 2008, which was won by Mr Nasheed. Mr Gayoom was jailed in June.