Mauritania's deposed prime minister has been released from house arrest five days after he was taken hostage in a military coup.
Yahya Ould Ahmed Waqef said just hours later that his country would not accept the coup.
Waqef was detained together with Sidi Ould Cheikh Abdallahi, the country's president, and several senior government officials when troops surrounded the presidential palace in the capital, Nouackchott, last week.
Speaking to thousands of supporters hours after being freed, Waqef said the president was in good health and urged the people to continue fighting to restore the democratically-elected government.
"The president thanks you for your untiring fight, your strong fight to restore constitutional order," he said.
Waqef's release comes after a meeting on Sunday when diplomats from the United States, France, Germany and Spain met General Mohamed Ould Abdel Aziz, the coup leader, to demand the release of the detained politicians.
The military also freed the interior minister and two other officials on Monday afternoon but refused to release Abdallahi and said it had no immediate plans to let him go.
Aziz launched the coup last week an hour after Abdallahi fired the country's top four generals, including him, following an increasingly bitter standoff between the president and the army.
Abdallahi, who last year won Mauritania's first free elections in over 20 years, had opposed the military's subsequent plan to hold elections on grounds that the president had failed to govern the country.