Gayoom improved on his first-round performance by courting supporters of tourist resort owner Qasim Ibrahim, who finished third in the first round with 23 percent of the vote. Ibrahim drew his support from conservative Muslims who accused Nasheed of undermining Islam because of his friendly relations with Israel and Western nations.
Addressing the nation after being sworn in, Gayoom said his main priority would be to "increase the love of the religion and the nation" and bring back stability. He also promised economic policy changes that would give more opportunities to youth, fishermen and farmers.
Nasheed was the clear pre-election favorite, but lost his momentum amid long delays to complete the election.
He conceded the election Saturday and said he would not challenge the results.
"This is a very happy day for all of us. We now have an elected president," he said. "We don't want to go to the courts."
The Maldives had failed to elect a president in three attempts since September, raising international concerns that the fledgling democracy may slip back to authoritarian rule.
Nasheed received 45 percent in a Sept. 7 election, but the result was annulled by the Supreme Court after Ibrahim complained that the voters' register contained made up names and those of dead people.
Last month, police stopped a second attempt at holding the election because all the candidates did not accept a new voters' list as the court had mandated.
The court intervened again to change the runoff election date, which had been set for the day after the Nov. 9 vote. It also ordered incumbent President Mohamed Waheed Hassan to continue in office despite the official end of his term on Nov. 11, purportedly to avoid a constitutional void because the country was past the legal deadline to elect and seat a new president.
The U.S. Embassy in Sri Lanka congratulated Gayoom and said it looked forward to working in partnership with him.
The Maldives has seen much upheaval in the five years since its first multiparty election. There has been conflict between the judiciary, Parliament and the presidency, which often worked in different directions. The judiciary and bureaucracy were often accused of being loyal to Gayoom, the former autocratic ruler.
Nasheed was elected in 2008, but resigned midway through his term last year after weeks of public protests and declining support from the military and police over his decision to detain a senior judge whom he perceived to be biased. He later said he was ousted in a coup, but an inquiry commission rejected the allegation.
The Maldives is a predominantly Muslim nation of 350,000 people. About 240,000 people were eligible to vote Saturday, and turnout was more than 91 percent.