India and the US congratulated the Maldives on conducting a peaceful democratic transition, after the vote was snubbed by bodies including the European Union for failing to meet the basic conditions for monitoring.
At a news conference televised live from the capital, Male, Mr Yameen admitted defeat, saying: "I know I have to step down now."
The result hands a surprise victory to opposition leader Ibrahim Mohamed Solih, and could have major significance for the wider region as China and India vie for influence in the strategic island nation.
President Yameen cultivated close ties with Beijing and drew criticism from New Delhi for his authoritarian tactics, cracking down on political dissent while jailing rivals and Supreme Court justices.
Mr Solih and his opposition alliance had dismissed Sunday's vote, with a turnout of almost 90 per cent, as unfair - right up to the point when they were declared winners by the Maldives Election Commission.
The commission's preliminary results showed Mr Solih with 134,616 votes and the incumbent Mr Yameen on 96,132 votes.
After Mr Solih claimed victory just after midnight on Monday, his supporters flooded the streets, hugging one another, waving the Maldivian flag, cheering and honking horns in celebration.
Mr Solih, 56, was a democracy activist during decades of autocratic rule and a former Parliament majority leader. He became the Maldivian Democratic Party's presidential candidate after its other top figures were jailed or exiled by the Yameen administration.
Relations between the Maldives and India, one of its main suppliers of imports, reached a nadir under Mr Yameen. When the president declared a state of emergency in February to bypass a Supreme Court order calling for the release of political prisoners, there was speculation that India could intervene militarily to throw Mr Yameen out.
India's foreign ministry said Sunday's election result marked "not only the triumph of democratic forces in the Maldives, but also... the firm commitment to the values of democracy and the rule of law".
It said India looked forward to working with Mr Solih's new government "in further deepening our relationship".
Although Mr Yameen's government was criticised over rights and freedoms, the Maldives' economy - traditionally reliant on tourism to its many islands - did grow in recent years. Economists largely put that down to Chinese aid and infrastructure development.
Indrani Bagchi, a leading commentator and Times of India diplomatic editor, said the Maldives under Mr Solih "will continue to have close ties with China, not least because of the debt and the demand of infrastructure which India is quite poor at".
"China won’t go away," she said. "But India is back in the game."
Join our commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies