It has seen better days and the bullet holes marks betray the act of bravery that plucked it to safety.

The flag was saved from a Gallipoli beach by a Scottish soldier under a hail of enemy gunfire after it had been accidentally left behind by Commonwealth troops being evacuated from the horrors of the First World War battlefield.

Not thinking about his own safety, Lt John Buchan-Hepburn leapt from his troop ship into the water.

Despite being shot twice, he managed to rescue the flags from under the noses of the Turkish soldiers, wrap them around his body and swim back to his comrades.

READ MORE: Communicating Remembrance to launch EIF 2018

Never decorated for his actions because he had broken King’s Regulations by carrying out the solo mission without orders, a grateful general allowed him to keep the flags in recognition of his bravery.

Now the Union flag is one of two that have gone on permanent loan to The Royal Scots Club in Edinburgh by Mr Buchan-Hepburn's family.

They will be the newly refurbished Hepburn Suite at The Royal Scots Club and hold a large historical significance to The Club’s heritage.

The second flag was a gift to Lt. John Buchan Hepburn from Lord Louis Mountbatten.

Buchan Hepburn owned a rubber plantation in Atale, Ceylon which was located near Mountbatten’s headquarters in Kandy. Whilst in Kandy, Buchan Hepburn met Mountbatten and offered his estate as a humble retreat if needed.

Their friendship began to blossom, they would spend time relaxing whilst Buchan Hepburn’s children were at school, discussing the history of India and Ceylon.

On Mountbatten’s final stay at the Estate, he gifted Buchan Hepburn his own union flag as a generous thank you and farewell.

Adrian Hayes, Manager of The Royal Scots Club, said: "It is a true honour to have such amazing historical artefacts right here in The Royal Scots Club, the flags commemorate the heroism of Lt. John Buchan Hepburn and what we stand for."

READ MORE: Freedom of Edinburgh for RAF squadron which shot down first Luftwaffe bomber of Second World War

When Britain went to war against Germany and its allies in 1914, Lt Buchan-Hepburn's father was working as a rubber planter in Ceylon, now Sri Lanka.

He was a member of one of Scotland’s oldest military families with a pedigree reaching back to the early 17th century.

Like many well-heeled young Scots of the era, the 18-year-old was keen to join the fight against the Kaiser.

He immediately helped to raise a regiment of plantation workers and the Ceylon Planters Rifle Corps was duly formed. Buchan-Hepburn was delighted to accept a commission.

With fronts opening up in the Mediterranean area, the regiment was seconded to the Australian army. After training in Egypt, the Ceylon Rifles were despatched to fight the Turks in the Dardanelles, along with other Anzac regiments.

In 1916, the Rifles were part of the unsuccessful Anzac force which went ashore at Gallipoli but were forced to retreat after a bitter campaign by a well-armed, well-drilled Turkish army.

After sustaining heavy losses, the Anzacs withdrew aboard a fleet of troop transporters.

But as the boats pulled away from the beach, a senior officer noticed that the two Union Jacks had been left flying in a forward trench headquarters position.

Shrugging the wound off, however, he wrapped and tied both flags around his body before setting off back down the beach. He reached the waterline without further injury but was shot again as he swam out to sea.

READ MORE: Former military chiefs call for shops to close on armistice centenary

Despite his wounds, Buchan-Hepburn made it back and was cheered on board for his gallantry.

But his ordeal was far from as he was transferred to a hospital ship because of his injuries still clutching the Union Jacks.

On arrival, he was asked if he would like to be bedded down on the top deck or down below because the vessel was very crowded.

While he was settling down on the top deck, the ship was passing out of the Straits of Dardanelle into the Mediterranean Sea, bound for Malta.

Before long it was torpedoed by a German submarine. With the ship sinking and listing on his side of the deck, Buchan-Hepburn, wrapped once again in the two flags, chose his precise moment to jump into the sea.

He swam out to a piece of wreckage and clung on until picked up by a British destroyer which had answered emergency calls. With other Australian wounded he was taken on to Malta.

As he recovered, two generals paid a visit to the ranks of wounded men.

Buchan-Hepburn later went on to serve in some of the harshest battles of the war at the Somme and at Ypres, where he was badly gassed.

At the end of the war he returned to Scotland bringing the precious flags with him to the family home in St Andrews. He died, aged 63, in 1953.