Rt Rev Dr Iain Greenshields formed part of the pre-procession of church leaders including the Dean of the Chapel Royal in Scotland, Very Rev Prof David Fergusson, in the service at Westminster Abbey.
Dr Greenshields was at Balmoral the weekend before the Queen died there on 8 September and said it was a "privilege and a real pleasure" to spend time with her.
He opened his prayer at the service on Monday with the words: "Let us give thanks to God for Queen Elizabeth’s long life and reign, recalling with gratitude her gifts of wisdom, diligence, and service."
Dr Greenshields preached before the then Prince of Wales at Crathie Kirk near Balmoral on 4 September and also spoke at a Service of Thanksgiving at St Giles’ Cathedral in Edinburgh last week.
Speaking after the service at Westminster Abbey, he said: "The last 10 days have been a whirlwind and yet time seems to have stood still.
"It was a privilege and a real pleasure to spend time in the company of Her Majesty the Queen.
"She was considerate in every respect and had clearly taken time to understand her guests.
"I was struck by her tremendous recall and her obvious love for Balmoral and, indeed, Scotland.
"Preaching before the then Prince Charles at Crathie was a pleasant experience and an honour, but little did I know that in eight days’ time I would be preaching in his presence at St Giles’ Cathedral with him now as King, as we gave thanks for his mother’s life.
"The tributes have been many and heartfelt and we have now held these final services and rites as the Queen is finally laid to rest.
"It is a time of reflection as we look at her life and examine our own before God.
"It is also a time to move on and we do so in hope and expectation."
Want a quick and expert briefing on the biggest news stories? Listen to our latest podcasts to find out What You Need To Know...