An overnight vigil will be held at the Scottish National War Memorial at Edinburgh Castle to mark the 100th anniversary of the Battle of the Somme.

The event is among four events taking place across the UK on the centenary of the largest battle on the Western Front during the First World War.

Alan Hamilton will blow the same whistle that his great-uncle used at 7.30am on July 1, 1916 as he led his troops into battle.

More than a million men were wounded or killed in the battle, 420,000 of them from the British Army.

British casualties on the first day were the worst in the history of the British army, with 57,470 casualties of whom 19,240 died.

On Thursday evening, members of the public will file through the memorial, passing the shrine where the casket containing the original Roll of Honour for the fallen will be guarded by sentinels.

Veterans, military personnel, descendants and other guests including culture minister Fiona Hyslop and Scottish Conservative leader Ruth Davidson will join members of the public to pay their respects at a short service at Canongate Kirk.

The service will be followed by an overnight candlelit vigil within the shrine.

Throughout Thursday night and into Friday morning, the vigil will be attended by representatives of regimental associations and services.

Edinburgh Castle will be lit in red floodlights from dusk as part of the commemorations.

On Friday morning, a second short service will be held after 7am, before a piper's lament and a two-minute silence marking the exact 100-year anniversary.

The silence, which will be synchronised across all four nations across the UK, will end with Mr Hamilton blowing the whistle that his great uncle blew 100 years ago at 7.30am.

A Benediction will follow, after which the Royal Scots Association vigil party will leave the memorial as a piper marks the end of the commemorations.

Mr Hamilton said: "My great-uncle Robert, then a young officer, blew this whistle and led his men into a fierce battle where many of them, his friends, were killed and wounded. He was with them until he, himself, was wounded.

"Throughout the vigil I will stand with others in silent reflection in an unspoken comradeship with those who went before us."

Major general Mark Strudwick, chairman of the Trustees of the Scottish National War Memorial, said: "The courage and sacrifice of the British soldiers who fought at The Battle of the Somme should never be forgotten.

"Few words conjure the tragic scale and staggering loss of life during the 141 days that battle raged.

"One hundred years on, we come together to honour them, to remember them and to ensure their memory and legacy lives on for generations to come."

Kevin Gray, chief executive officer at Legion Scotland, said: "We must never forget the sacrifice made by those who fell at the Battle of the Somme.

"Remembering those brave soldiers is extremely important and I would urge the public to join with almost 100 veterans and nine military associations representing the Royal Navy, army and Royal Air Force to pay their respects at the vigil on June 30."