Muhammad Jamil Wald Mansour was given conditional release on Tuesday, two weeks after prosecutors said he was being held for leaving the country illegally.
Wald Mansour escaped from prison and fled Mauritania last June under cover of a coup bid that rocked the capital Nouakchott for 36 hours.
The coup was later quelled by troops loyal to President Muawiya Wald Taya.
Mansour's lawyer, Ibrahim Wald Ebetty, called the original accusations "absurd" as guards had forced prisoners to leave the jail.
The opposition activist was jailed at the start of June along with 40 others, many of them from Islamic organisations, for "plotting against the constitutional order".
Wald Mansour, a former mayor of one of the capital's districts and a member of the opposition Rally of Democratic Forces (RFD), fled to neighbouring Senegal and then spent seven months in self-imposed exile in Belgium.
Wald Taya was reelected in November, but the main opposition candidate Muhammad Khouna Wald Haid Allah was arrested the day after the vote and later convicted for plotting a coup.
Muawiya Wald Taya has been
accused of rights abuses
Human rights abuses
Mauritania has been regularly condemned for human rights abuses by international watchdogs.
In a recent report, Amnesty International said suspects, particularly those in politically sensitive cases, were held incommunicado in the country.
Scores of demonstrators were ill-treated by police as they broke up demonstrations, Amnesty said.
And the report added that freedom of expression and the independence of the judiciary were under threat.