text: Beji Caid Essebsi, who won the first round with 39% of the vote, is challenging interim leader Moncef Marzouki.
  Mr Essebsi represents the secular-leaning Nidaa Tounes party.
  Tunisia was the first country to depose its leader in the Arab Spring and inspired other uprisings in the region.
  Polls closed at 18:00 local time (17:00 GMT). Voter turnout had reached 36.8% after four and a half hours of voting, Tunisia's election authority said.
  Shortly after polls closed, Mr Essebsi's office said that there were "indications" that he had won.
  However, a spokesman for Mr Marzouki said the claims were "without foundation".
  Mr Essebsi, who turned 88 this week, held office under both deposed President  Zine el-Abedine Ben Ali and Tunisia's first post-independence leader, Habib Bourguiba.
  He is popular in the wealthy, coastal regions, and based his appeal to voters on stability and experience.
  His opponent, Moncef Marzouki, is a 67-year-old human rights activists forced into exile by the Ben Ali government.
  He has been interim president since 2011 and is more popular in the conservative, poorer south.
  After casting his ballot, Mr Marzouki said Tusinians "should be proud" of themselves "because the interim period has come to a peaceful end".
  Mr Marzouki 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.
  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.
  In the build-up to the vote, a video emerged of Islamic State militants claiming responsibility for the 2013 killings of two Tunisian politicians.
  The men in the video also condemned the election and threatened more killings.
  An interior ministry spokesman dismissed the video, saying the group "mean nothing to us".
  About 5.2 million Tunisians were eligible to vote in the run-off poll. At least 88,000 observers oversaw the election, according to Tunisian state media.
target: Voters in Tunisia have been choosing their first freely elected president in a run-off election seen as a landmark in the country's move to democracy.