The Ryder Cup captain collapsed shortly before he was due to give an after-dinner speech at a hotel in Aberdeen on August 29.
He was believed to have just returned from a family holiday with his wife Lesley and Sky Sports presenter daughter Kirsty Gallacher in Spain.
An NHS Grampian spokeswoman said: "Mr Gallacher is no longer a patient of ours as of today."
His distraught family travelled up to Scotland and kept a vigil at his bedside as he battled for his life.
His daughter Kirsty gave thanks for the support received by her family since her father became ill.
She tweeted that it had been "quite overwhelming", adding: "Dad now making a good recovery."