According to the ministry, the bail decision was based on a doctor's report that Abdel Aziz needed a stress-free environment and a special diet.
Now 65, Abdel Aziz was moved from house arrest to state custody in June last year since stepping down in 2019 after serving two five-year terms.
The former president will however remain under judicial and medical supervision.
In late December he was admitted to a hospital in the capital Nouakchott for heart treatment and his family have called for his evacuation abroad.
One of his lawyers, Mohameden Ichidou welcomed the move and said it was a step forward. Adding that it will allow them to continue to demand the release of an innocent man who is seriously ill.
Mohammed Ould Abdel Aziz has continuously denied the corruption allegations.