The centenary of the biggest naval battle of the First World War has been marked with a service which paid tribute to the thousands of sailors who lost their lives.

Prime Minister David Cameron, First Minister Nicola Sturgeon and the Princess Royal joined descendants of those who fought at the Battle of Jutland for the service to remember the 8648 seamen who died in the most decisive sea engagement of the war.

Tuesday marks 100 years to the day since British and German ships engaged in a 36-hour conflict off the coast of Denmark which led to the devastating losses and changed the course of the war.

British and German military bands played and crowds lined the street as the Prime Minister arrived at St Magnus Cathedral in Kirkwall, Orkney, with the First Minister.

Guests, naval officers and descendants passed a display of thousands of ceramic poppies installed in tribute to the war as they arrived at the UK's most northerly cathedral.

A message from the Duke of Edinburgh, who was unable to attend, was carried in the order of service for the commemorations.

Prince Philip said: "There was, understandably, public disappointment with the result, but there is no doubt it was fought with the highest courage and determination under the most difficult and challenging circumstances.

"Whatever the judgment on the outcome, the commemoration of the centenary of the battle is focused on the endurance and gallantry of all those who took part, on both sides, and particularly on those who lost their lives.

"War may be senseless and the Battle of Jutland may have been inconclusive but there can be no doubt that their sacrifice was not in vain."

Princess Anne represented the royal family at the memorial after the Duke of Edinburgh cancelled his trip on doctor's advice.

She was accompanied by husband vice-admiral Sir Tim Laurence as vice-chairman of the Commonwealth War Graves Commission.

German president Joachim Gauck was also in attendance.

Mr Cameron said in the order of service that it was a reminder that the First World War was not only fought in battlefield trenches.

He said: "The strategic importance of Scapa Flow cannot be overstated and it is therefore highly symbolic that today the stark and striking beauty of the Orkney Islands provides the backdrop to our commemorations.

"It is very moving that we are joined today by the descendants of some of those who served at sea during the war.

"We stand together with them to pay our profound respects to their ancestors and to ensure that the events of a hundred years ago will be remembered and understood in a hundred years' time."

During the service, the Prime Minister read from the Song of Songs while descendants and officers from the British and German Navy read diary extracts from officers who fought in the battle.

A candle of remembrance was lit and wreaths were also laid at the cathedral, while a specially-commissioned piece of music by the late composer and Orkney resident Sir Peter Maxwell Davies was performed.

A second service has been held at Lyness Cemetery on the island of Hoy, the final resting place for more than 450 service personnel who died in the war, including sailors killed at Jutland.

The cemetery stands close to Scapa Flow, from where the British Grand Fleet set out for the Jutland Bank to repel the German High Seas Fleet attempting to break a British blockade.

Almost 250 ships took part, creating a scale of battle that has not been seen since.

There will also be a remembrance service at sea where British and German naval representatives will scatter poppies and forget-me-nots - the German flower of remembrance - into the North Sea at Jutland Bank.

Commemorative events marking the Jutland centenary have previously been held at Rosyth and South Queensferry on the Firth of Forth, from where the Battlecruiser force set sail ahead of the battle on May 31, 1916.