Six days of intensive negotiations aimed at resolving Mauritania's political crisis began at a seaside hotel in Dakar, Senegal's capital, on Thursday.
The talks were organised by an international group of mediators, including officials from the African Union, the European Union, the United Nations and the Arab League among others.
Sidi Ould Cheikh Abdallahi, Mauritania's first democratically elected president, was toppled in a coup in August 2008.
Abdallahi's ouster was spearheaded by General Mohamed Ould Abdel Aziz, who's decision to give up power in last April constitutionally allowed him to run in the elections that were meant to return civilian rule to Mauritania.
Meanwhile, hundreds of Abdallahi's supporters gathered at the airport in Nouakchott, Mauritania's capital, to cheer delegations arriving from the Dakar talks hailing the agreement as a good move.
Opposition parties initially rejected the elections, saying it was being organised without their consent.
Their absence would have given Aziz almost certain victory, but deprived his win of any credibility.
According to the agreement, Aziz would have the right to appoint the prime minister and half the ministers, and rival parties the rest.
If no candidate wins a majority of votes in July's election, a second round will be held August 1.
The African Union suspended Mauritania from membership and has imposed travel bans and asset freezes on officials involved in the coup.