Police said the authorities had not been notified of the march and that it was not authorised. There are no reports of casualties.
The demonstration on Wednesday was called to protest a police raid on the home of one of the candidates, Muhammad Khuna Wald Hidala, and the subsequent arrest of one of his sons.
Several hundred people who had gathered for the march in central Nouakchott dispersed without incident before the arrival of Hidala, a former head of state who was overthrown in a 1984 coup by the current president, Muawiya Wald Taya.
Two other candidates - Ahmad Wald Hidala, the half-brother of the late Muktar Wald Dadah, Mauritania's first president, and Massaud Wald Bilkhair, the first descendant of slaves to run for president here - had planned to join in the protest.
Hidala spokesman said the march was called to protest against "the methods used by the government to disrupt the election and halt the dynamic of change".
Police said they had searched Hidala house as well as those of "some of his supporters and some mosques" and that two guns had been seized as "a precaution".
They said they had been informed of "the determination of extremist groups ... to dispute with violence any result of the election that is not favourable to them".
On Tuesday, Hidala's eldest son, Sidi Ahmad, was arrested and accused of "engaging in intimidating and threatening acts with the aim of infringing public security", according to a police statement.
Sources close to the candidate said that another son, Sidi Muhammad, had since been arrested on the same charges.
Friday's election is the most hotly
contested since independence
The election comes six months after an attempted military coup was violently quashed in the former French colony.
Hidala's spokesman, Ely Wald Snaiba, said the police moves "target the person and the family of the candidate and the certain popularity he enjoys".
He added that if Taya was re-elected on Friday his victory would only be recognised if the vote took place "without fraud and in a transparent manner".
Human rights fears
The New York-based group Human Rights Watch warned in September of a "climate of harassment of opposition members" in Mauritania and voiced fears over the fairness of the upcoming vote.
It noted the arrests of dozens of religious leaders, opposition politicians and social activists on allegations of involvement in "terrorist" activities.
The government has not invited foreign observers to monitor the poll.
The election will go to a second round two weeks later if none of the candidates takes more than 50% of the vote on Friday.
Taya has won two elections since he ousted Hidala in 1984 - in 1992 amid fraud charges and again in a 1997 vote largely boycotted by the opposition.
The two other candidates in Friday's vote are Mulaya al-Hasan Wald Jiad, who picked up less than one percent of the vote in 1997, and the first woman contender, Aisha Bint Jidana.