Mugo, who denied charges of rape and other offences, was freed on Wednesday after raising Sh5 million bond.
“Free at last! Free at last! Free at last,” he later wrote on Facebook.
“The 40 days and 40 nights of torment have only strengthened me and hardened my resolve.”
Wairimu allegedly sedated and raped a patient in his illegal clinics in Githurai and Zimmerman estates. Charges he has denied.
He had been detained at Industrial Area Prison after failing to raise Sh1 million bail or the bond.
The quack gynaecologist had been in police custody since September 10, after he was arrested over a video showing a man, said to be him, sexually abusing a sedated woman on a hospital examination table.