Mohamed Nasheed arrived at the embassy on Feb. 13 after a court ordered his arrest for not attending a hearing on charges that he illegally ordered the detention of a senior judge, a move that led to his ouster from power last year. The court issued a second warrant during Nasheed's stay at the embassy, but police were unable to execute it because they were not allowed to enter a diplomatic building.
Nasheed has said the case against him is politically motivated to disqualify him from contesting the presidential election scheduled for September.
Nasheed did not explain why he left the embassy on Saturday, but said he believed he would be free to participate in politics. His party had said earlier that Nasheed would leave the embassy only if a caretaker government was appointed to oversee the election. The party says President Mohammed Waheed Hassan, a former deputy to Nasheed, cannot be trusted to hold a fair election.
Government spokesman Masood Imad said Saturday that no compromise had been reached with Nasheed regarding the case against him.
India's foreign ministry said in a statement that two visiting diplomats held discussions with the government and Nasheed to bring about a breakthrough. It said Nasheed entered the embassy "on his own volition and had similarly decided to leave on his own."
Nasheed became the first democratically elected president of this Indian Ocean archipelago in 2008, ending a 30-year autocracy. He resigned last year following weeks of public protests over his order to arrest the judge.
An inquiry commission last year ruled out Nasheed's claim that he was ousted in a coup.