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
Novak Djokovic has secured his fifth Australian Open title with a four set 7-6 (7-5), 6-7 (4-7), 6-3, 6-0 victory over Andy Murray
Fire crews released a woman from an overturned car after it went off the A12 at Ingatestone in Essex.
Star of cult TV drama The Wire actor Idris Elba has said he sees himself as "an odd, tall black man that doesn't quite fit in".