Police said Constable Gellatly's family have been informed of his death and officers from an independent force, Lothian and Borders Police, will oversee the investigation.
Assistant Chief Constable Bernard Higgins said: "It is with great sadness that I confirm a serving
Strathclyde Police officer died today in an incident where a firearm was discharged at Baird Street Police Office.
"Our thoughts are with the officer's family and friends at this difficult time."
Brian Docherty, chairman of the Scottish Police Federation, said: "It is too early to speculate as to the circumstances surrounding the tragic death and our thoughts turn immediately to his family who have lost their loved one and colleagues who have lost a friend."
More top news
The man identified as the Islamic State militant known as "Jihadi John" was a "popular" schoolboy who loved Manchester Utd and S Club 7.
Everton, the only British side left in the Europa League, have been handed a tough tie against Dynamo Kyiv in the last 16 round
Ukip remains the party most trusted to control immigration despite more people seeing them as racist, a ComRes/ITV News poll has found.