Moncef Marzouki has refused to admit defeat in Tunisia's first free presidential election after exit polls suggested Beji Caid Essebsi had won.
The caretaker president, a former exile, said his rival's declaration of victory was "undemocratic".
Mr Essebsi, 88, has been celebrating with supporters, telling them all Tunisians now need to "work together", and promising to bring stability.
Critics say his success marks the return of a discredited establishment.
Official results are not expected until Monday evening. One exit poll gave Mr Essebsi 55.5%, with several others showing similar figures.
The election marks the last stage of Tunisia's move to democracy, after the 2011 overthrow of President Zine el-Abedine Ben Ali.
It is the first time Tunisians have been able vote freely for their president since independence from France in 1956.
'Undemocratic'
Mr Marzouki, a 67-year-old human rights activist forced into exile by the Ben Ali government, said the election was too early to call.
"The announcement of victory is undemocratic and we should wait if we want to be a state that respects the rule of law," he told supporters.
"What I want to tell you is that we are victorious, we are victorious , we are victorious. Tunisia has won and you have won. You have won for Tunisia, for democracy and for human rights."
Mr Marzouki has been interim president since 2011 and is more popular in the conservative, poorer south.
He was thought likely to attract support from the moderate Islamist Ennahda party, which has played a key role in Tunisian politics since the Arab Spring but did not field a candidate.
Coastal candidate
Mr Essebsi appeared on television after polls closed on Sunday, saying: "I dedicate my victory to the martyrs of Tunisia."
"I thank Marzouki, and now we should work together without excluding anyone," he added.
Supporters danced and let off fireworks outside the headquarters of Mr Essebsi's secular-leaning Nidaa Tounes party.
Mr Essebsi held office under both deposed President Zine el-Abedine Ben Ali and Tunisia's first post-independence leader, Habib Bourguiba.
He led in the first round of voting last month with 39% of the vote. Mr Marzouki polled 33%.
He is popular in the wealthy, coastal regions, and based his appeal to voters on stability and experience.
Reduced role
Whoever wins faces restricted powers under a constitution passed earlier this year.
The president will be commander-in-chief of the armed forces but can appoint or sack senior officers only in consultation with the prime minister.
The president will also set foreign policy in consultation with the prime minister, represent the state and ratify treaties.
Tunisia boosted security for the elections and closed border posts with Libya, which has been plagued by unrest.
A group of at least three attackers targeted a polling station near the city of Kairouan on Sunday morning. Security forces say they killed one attacker and arrested three.
Latest Stories
-
We don’t help candidates win elections – EC
4 mins -
Ejisu by-election: NPP will win with a clear margin – Nana B
15 mins -
Ejisu by-election: Police will be heavily present to maintain law and order – EC
24 mins -
3 confirmed dead in Ejisu-Konongo Highway collision, 1 injured
2 hours -
Fatawu Issahaku gets assist as Leicester City beat Preston to win Championship title
2 hours -
Child’s right advocate criticises state’s handling of ‘victim’ in alleged child marriage case
2 hours -
NPP has created 2.1m jobs in seven years – Bawumia
3 hours -
Akosombo Dam spillage: We’re considering a class action suit against government – Ablakwa
3 hours -
Government offers teacher unions about 70% increment in continuous professional development allowance
3 hours -
Everyone must show interest in depleting pension funds – Pensions Expert
3 hours -
African Business Heroes: African SMEs ready to compete for a share of $1.5m grant
4 hours -
My government will partner with faith-based groups in development – Bawumia
4 hours -
Joy Prime’s Prime Morning to host show at sea in May Day celebration with Ghana Navy
4 hours -
Why increase contribution rate when you can’t manage what is given to you? – NAGRAT asks SSNIT
4 hours -
There are greener pastures in Ghana – Prof Owusu-Dabo
6 hours