"If anything is shown by this vote, it's that I'm still the most popular public figure in this country," he said.
Gayoom, who leads the Dhivehi Rahyithunge Party (DRP), has presided over the Maldives since 1978, but he faces a tough challenge in the runoff after Hassan Saeed, the former attorney-general who came in third, threw his support behind Nasheed.
"The vast majority of people are against Gayoom ... they want a change," Nasheed said.
Turnout was high for the historic poll, with more than 80 per cent of 208,000 eligible voters taking part, the election commission said.
Voting at some polling stations had been extended to allow the people queueing to cast their ballot after the original deadline passed.
Cluster of 1,192 islands scattered across 800km of Indian ocean off southern India
Population 300,000, mostly ethnic Dravidians, Indo-Aryans, Sinhalese and Arabs
Official religion: Islam
Official language: Dhivehi, although English and Arabic are widely spoken
Economy is dependent on tourism with growth averaging seven per cent
Timeline: Maldives political milestones
Gayoom allowed the presidential election to go ahead after pro-democracy protests and pressure from other nations, marking a sea change in Maldivian politics.
At one time it was illegal to criticise the president and rival political parties were only permitted two years ago.
Before the election, the MDP had accused Gayoom of trying to rig the poll and secure a first-round win.
The election commission said on Thursday that it had received more than 1,000 complaints about the poll, but most of them were about registration problems and were resolved.
Nasheed accused the ruling party of deliberately tampering with the voter lists and stuffing ballot boxes.
"There will be fraud. We won't have a free and fair election. It will be as free and fair as possible and we'll have to win above the amount of rigging," he said.
The party had concentrated its campaign in the capital, Male, while Gayoom had toured the country's outlying atolls in an attempt to secure support from conservative voters.
Gayoom has been praised for helping bring major development to this small nation of 1,190 coral islands but, although the nation is the richest per head of population in south Asia, it faces a housing shortage, rising crime and drug abuse.
The president has said that he is the only individual who can implement changes across the country, but opposition parties have accused him of using corruption and strong-arm tactics to maintain his rule.