He had been treated for a mini stroke.
According to a member of his entourage, Keita left hospital on Thursday evening. He may now head to the United Arab Emirates for further treatment, the source added.
Keita was forced out of office on August 18 by young military officers who staged an uprising at a base near Bamako, the capital, before heading into the city, where they seized Keita and other leaders.
Pressure from regional bloc, ECOWAS, led to his release on August 27 from the hands of the Junta that seized him. But he was still placed under surveillance in his residence in Bamako until he was admitted to a private hospital on Tuesday.
Keita, 75 years old is thought to have suffered a transient ischaemic attack. He still had about three years left in his second term as president before being ousted, a dramatic twist to several months of increased opposition against his administration.