Early unconfirmed reports from Senegal's controversial presidential election indicate a tight race between incumbent Abdoulaye Wade and former Prime Minister Macky Sall.
If no candidate wins an outright majority there will be a run-off.
President Wade, 85, is seeking a third term in office despite serving a constitutional limit of two terms.
A crowd at a polling station in the capital, Dakar, booed Mr Wade as he cast his vote.
They could be heard shouting: "Get out, old man!"
Mr Wade's decision to stand again has sparked weeks of violent protests, although polling day itself was largely peaceful.
Early unofficial results showed Mr Wade with about 24% of the vote ahead of nearest rival Mr Sall on 21%.
Senegal's constitutional court ruled that Mr Wade could stand again on the grounds that his first term had not counted since it began before the two-term limit was introduced in 2001.
The court also barred world-famous singer Youssou N'Dour from standing in the election.
Mr N'Dour has argued that allowing Mr Wade to run again amounts to a constitutional coup d'etat.
Senegal, a former French colony, is seen as a stable democracy with an unbroken series of elections since independence in 1960.
It remains the only West African country where the army has never seized power.
A cacophony of boos and jeers drowned out clapping from a few dozen supporters when Mr Wade appeared at the polling station in the Dakar suburb of Point E, where he owns a private home, AFP news agency reports.
More than 100 people booed and chanted "Wade go away" in the local Wolof language, Reuters news agency said.
Visibly angry, the elderly leader reportedly pushed aside one of his own bodyguards as he beat a swift retreat after voting, without speaking to the media.
Earlier, he had dismissed opposition protests as "temper tantrums".
Despite the ill-feeling, long lines of voters could be seen waiting patiently to cast their ballots in Senegal.
In the working-class neighbourhood of Parcelles Assainies, many people turned out in their best clothes for the event.
"You can see the determination of the people, they want change," Awa Faye Ndoye, a housewife, told Reuters after voting.
She predicted people would take to the streets in protest if Mr Wade was declared the winner.
'Father of the nation'
Mr Wade is one of 14 candidates who also include Mr Sall and Idrissa Seck, both former prime ministers who served under him.
However, he is confident of victory, insisting his advanced age is an asset.
"My age has become an advantage," he told French weekly Sunday newspaper Le Journal du Dimanche.
"I am president and father of the nation. This is what the Europeans do not understand."
Most opposition candidates have called on their supporters to go to the polls and vote Mr Wade out of power but they have also insisted they will not recognise his victory if he is re-elected, the BBC's West Africa correspondent, Thomas Fessy, reports from Dakar.
Speaking at a polling station in Dakar's Amitie district, N'Dour said: "We will not accept an electoral coup here.
"The Senegalese are not stupid... The rest of the world is watching what goes on in Senegal very closely."
International leaders appealed for calm ahead of the vote.
The African Union's envoy, former Nigerian President Olusegun Obasanjo, proposed that Mr Wade retire after two years if re-elected.
But his plan was not accepted by either the president or the opposition.
Once a veteran opposition leader himself, Mr Wade was first elected in 2000 - ending 40 years of rule by the Socialist Party.