The 19-year-old has been named as Josh Wilson.
He was admitted to Edinburgh Royal Infirmary after falling through the roof of St Mary’s Primary School on East London Street in the early hours of Sunday morning.
The soldier, from Stevenson in North Ayrshire, died of his injuries in hospital on Tuesday morning.
In a statement, a police spokesperson said: “Police in Edinburgh were called to East London Street shortly before 5am on Sunday 7 May following a report that a man had fallen through the roof of St Mary’s Primary School.
“The 19-year-old was taken to Edinburgh Royal Infirmary for treatment but he sadly succumbed to his injuries on Tuesday 9 May.
“A report will be sent to the Procurator Fiscal.”