Starting the procession from the Scottish capital's Signet Library, the Queen, Anne, William and Philip made their way along the Royal Mile, which was lined with well-wishers.
CLICK ON PHOTO FOR FULL GALLERY
The Queen and the Duke of Edinburgh
A majestic fanfare and a mounted guard of honour greeted the royals as they entered the cathedral, while the band of the Royal Regiment of Scotland played in West Parliament Square.
Thursday's ceremony saw Glasgow 2014 Commonwealth Games chairman Lord Smith of Kelvin and Consevative peer and former Coutts bank chairman the Earl of Home installed as Knights of the Thistle, Scotland's highest national honour.
Left to right: the Queen, Prince William, the Duke of Edinburgh and Princess Anne
The Order of the Thistle is an award bestowed on men and women who have held public office or made a significant contribution to national life and is second in precedence only to the UK's Order of the Garter.
Princess Anne was invested in the Order of the Thistle in June 2001 while Prince William, who holds the title of the Earl of Strathearn in Scotland, was installed in 2012.
After the service the royals headed to Holyrood Palace
Following the service the royals headed to Holyrood Palace, the Queen's official residence in Scotland, where the monarch hosted a lunch and then a reception in the Great Hall.
The quartet later attended the dedication of a new memorial garden in the castle grounds, where the Queen unveilled a plaque made up of metals donated by the armed forces to mark the centenary of the First World War.