The funeral and lying-in-state of Queen Elizabeth II in September 2022 cost the British government an estimated £161.7 million ($200.5 million), figures show.
The largest cost was reported by the Home Office at £73.7 million, followed by the Department for Culture, Media and Sport (DCMS) at £57.4 million.
The cost to the Scottish Government is estimated at £18.8 million, which is likely to have included events such as the lying-in-rest in Edinburgh following her death at Balmoral Castle in Aberdeenshire.
The figures have been published by the Treasury as part of a written statement to the UK Parliament and cover the period from her death on September 8 to her funeral in London on September 19.
Downing Street said the cost was used to facilitate the smooth running of the event and ensure mourners from Britain and across the world could visit and take part safely.
"Of course, a major international event of this scale, we wanted to ensure that we could enable people to pay their respects," a government spokesman said.
Other costs include £2.9 million by the Ministry of Defence, £2.6 million by the Department for Transport, £2.2 million by the Welsh Government and £2.1 million by both the Foreign, Commonwealth and Development Office and the Northern Ireland Office.
The Treasury said that the costs include "fully refunding" the Scottish and Welsh Governments, and the Northern Ireland Office, "which in turn they were able to repay to partners who also incurred costs".
The late Queen's final farewell was the nation's first state funeral for more than half a century, with the last one held for wartime prime minister Sir Winston Churchill in 1965.
The Ministry of Defence was heavily involved in the official days of mourning and the Queen's funeral, providing the ceremonial troops who played a pivotal role, from acting as coffin bearers to flying the monarch from Edinburgh to the capital.
The C-17 Globemaster aircraft, used for aid missions in Ukraine and to help evacuate people from Afghanistan when the Taliban returned, flew the coffin to RAF Northolt in north-west London.
DCMS costs covered a number of aspects of the state funeral, including crowd management and stewarding, infrastructure, and accreditation for the lying in state and state funeral in London, as well as supporting stewarding and accreditation in Windsor.
Around 250,000 people filed past the Queen's coffin as it lay in state at Westminster Hall from September 14-19, with members of her family including her children – the King, Princess Royal, Duke of Edinburgh and Duke of York – standing guard around her coffin.
Prime ministers, presidents and foreign royals travelled from across the world to gather with the Windsors in mourning in Westminster Abbey on September 19 for the funeral.
More than 2,700 military personnel took part in the procession or lined the route to the abbey.
The Queen's coffin was placed on to a 123-year-old gun carriage towed by 98 Royal Navy sailors in a tradition dating back to the funeral of Queen Victoria, with 40 sailors marching behind to act as a brake.
A committal service was held later the same day at St George's Chapel in Windsor Castle for 800 guests, with the royal family joined by members of the Queen's household past and present and personal staff from across her private estates.
The Queen Mother's funeral arrangements in 2002 cost more than £5.4 million – around £9.3 million in today's money.
A fly-past and a lying-in-state in Westminster Hall were among the events honouring King George VI's consort.
She was given a ceremonial royal funeral, rather than a state one, in keeping with tradition.
Diana, Princess of Wales's funeral – a form of a ceremonial royal one – is estimated to have cost between £3 million and £5 million in 1997 – worth between £5.5 million and in £9.2 million in 2023.