The prime minister will write a private letter to the head teacher of Cults Academy following the loss of one of her pupils.
A senior government source told the Press and Journal David Cameron would be getting in touch with Anna Muirhead.
She voiced the community’s devastation in the immediate aftermath of the stabbing of Bailey Gwynne, who she described as “gentle and caring”.
The source declined to reveal any details about what the letter would say, stressing its private nature.
News of Mr Cameron’s intended intervention emerged as MPs in the Commons expressed their condolences after the “appalling tragedy”.
The chairman of the Scottish affairs committee, SNP member Pete Wishart, raised the incident at the start of the weekly business statement yesterday.
He said: “I’m sure like me your thoughts are very much with the school community of Cults Academy who are tragically mourning the loss of one of their pupils.”
He also told the House that Aberdeen South MP Callum McCaig was a former pupil of the school.
“I know that particularly for those of us who represent the north-east this was an appalling tragedy that we witnessed,” he added.
Mr McCaig spoke about his heartbreak after hearing the news about his old secondary school, which he said he knew as a “safe and caring place”.
Politicians from all parties were quick to offer messages of support.
Scottish Secretary David Mundell called it “terrible news” and his opposite number Labour’s Ian Murray a “tragic event”.