Scotland will mark the 100-year anniversary of the outbreak of the First World War with a special service at Edinburgh Castle next August.

A "drumhead" service will be held on the castle esplanade, replicating the church services conducted on the front line where neatly-piled drums were used as makeshift altars.

First Minister Alex Salmond announced details of the service and other commemorative events to mark the centenary of the Great War.

A five-year programme has been compiled by a specially-created Scottish Commemorations Panel headed by former Army Chaplain Norman Drummond.

Scotland will mark the battles at Loos and Arras, where Scottish battalions suffered a high number of casualties, and domestic incidents such as the loss of HMS Iolaire.

Speaking at the Royal British Legion Scotland annual conference in Perth, Mr Salmond said: "Next year and throughout the following five years, people in communities across Scotland will gather together and remember the exceptional sacrifice made by their sons during the brutal conflicts of the Great War.

"The Great War commemorations are in no sense a celebration of the centenary of this devastating conflict.

"They are a commemoration, which will give the whole of the country the opportunity to reflect on the impact that the First World War had on Scotland during a programme of significant dates I am outlining today.

"As well as marking the outbreak of war with a drumhead service at Edinburgh Castle, this programme will see commemorations of major military battles with a particular resonance for Scotland, such as those at Loos and Arras, and the observance of the anniversary of significant domestic events, such as the train crash at Quintinshill and the loss of HMS Iolaire.

"By reflecting on these devastating events, and the consequences they had for communities the length and breadth of Scotland, we will help people of all ages in this country understand more about the futility of war and strengthen our resolve to never let a tragedy like the Great War happen again."

On May 22, 1915, the Leith-based 7th Battalion Royal Scots, Territorial Force were on their way to Liverpool for Gallipoli and lost 214 officers and men in a train crash at Quintinshill, near Gretna.

In the Battle of Loos on September 25 that year, part of the first Allied offensive in Artois and Champagne, half of all casualties were Scottish. Five Victoria Crosses were awarded to Scots, including an award to piper Daniel Laidlaw who braved poison gas and gunfire to play his company forward.

In the Battle of Arras on April 9, 1917, 44 Scottish battalions and seven Scottish-named Canadian battalions attacked on the first day in the largest concentration of Scots to have fought together during the war.

HMS Iolaire was carrying soldiers back to Lewis when it struck rocks and sank off the coast of Stornoway on January 1, 1919, with the loss of 205 men.

Mr Drummond said: "The dates recommended by the Scottish Commemorations Panel reflect the impact that the First World War had on Scotland.

"As well as aligning with the UK commemorative programme, these dates enable Scotland to remember the specific and significant contributions made by our servicemen and women and our local communities in very challenging times throughout the First World War and beyond."

Earlier this week the Scottish Government announced £1 million funding for secondary school pupils to visit battlefields on the western front.