South African president's office says Nelson Mandela has left hospital and has returned home.