The election commission's results show Mr Solih with 134,616 votes and Mr Yameen with 96,132 votes.
"The message is loud and clear".
Pakistan has congratulated the people of Maldives on the peaceful conclusion of its Presidential election.
Solih was backed by a united opposition intent on ousting strongman Yameen and emerged victorious despite struggling to gain public visibility because local media faced draconian decrees and reporting restrictions.
Mr Yameen, who has been accused of crushing dissent in the archipelago, admitted defeat, saying he accepted the result.
Ibrahim Mohamed Solih, the president-elect of the Maldives, spent his youth marching in the streets for democracy. Supporters cited his 25-year career as a parliamentarian as evidence of his commitment and self-restraint - in contrast to some of the country's more power-hungry political leaders. He has led the opposition in parliament since 2011.
Signalling the impact of the result on India, which has been at loggerheads with the Yameen government over a number of issues, the Ministry of External Affairs "heartily" congratulated Solih and hoped that the "Election Commission will officially confirm the result at the earliest".
The US State Department, which had warned of "appropriate measures" if the vote was not free and fair, had called on Yameen to "respect the will of the people".
Monitors said a record number of people voted on Sunday, with queues snaking around the blocks of many polling booths and the voting deadline extended by three hours to accommodate the demand.
Nasheed was forced to resign in 2012 after losing military and police support over the arrest of a prominent judge.
What role has China played in the Maldives?
India and China, jostling for influence in the Indian Ocean, had been watching the election closely.
"[The] people of the Maldives have taken back their country".
Mohamed Shainee, the minister of fisheries in Yameen's government, said on Twitter it was "the beginning of a new chapter" for the country. China funded the development of Sri Lanka's Hambantota seaport, and when Sri Lanka could not pay its debt, China took control of the seaport and substantial land in the region, creating a large enclave of Chinese workers and their families.
Delhi thus sees China's lavishing of loans on the Maldives as part of a wider strategic ambition to secure another foothold in the Indian Ocean, he added. "I don't think he could give any concrete reason to call it unfair". "But we did not get the required visa", he told Reuters.
An elections-eve police raid of Solih's main campaign office cast a pall over the vote.
Yameen's campaign did not concede the race, and no one from the campaign could immediately be reached for comment.