Gen Mohamed Ould Abdelaziz seized power last year
Rival parties in Mauritania have agreed to postpone Saturday's presidential election until 18 July.
The agreement was announced by Senegalese Foreign Minister Cheikh Tidiane Gadio, following several days of intense negotiations in Dakar.
He also announced the formation of a transitional unity government, to include members of the opposition.
They had refused to take part, arguing it was to legitimise Gen Mohamed Ould Abdelaziz, who seized power last year.
Hundreds of Mauritanians gathered at the capital's airport to welcome the negotiators home from Senegal, AFP news agency reports.
"We thank the international community and President [Abdoulaye] Wade for having helped us overcome this crisis peacefully," opposition member Mohamed Moustafa Ould Bedredine said.
After August's coup, the African Union suspended Mauritania from its membership and imposed travel bans and asset freezes on officials.
Mauritania has a long history of coups, with the military involved in nearly every government since its independence from France in 1960.