The Queen has thanked civil servants who played a "crucial role" during the handover of power after the general election resulted in a hung parliament.
In a visit to the Cabinet Office she met the men and women who handled the transition last month.
She later sat in on the weekly meeting of more than 35 civil service heads of government departments.
One said it was a "great tribute" that the Queen had wanted to come and show recognition of the job they did.
Matt Tee, permanent secretary for government communications, said the visit had been "great honour".
As the country waited to see whether the Conservatives and Liberal Democrats could form a coalition government, Whitehall officials hosted the meetings between the two parties at Cabinet Office buildings.
The team provided logistical support and advice on constitutional issues during the negotiations and senior officials worked with the Queen's private secretary Christopher Geidt, who briefed her about developments.
Mr Tee added: "I think that the role that the civil service helped to play in the formation of the new government meant the Queen was not pulled into a party political situation."
The visit was hosted by Sir Gus O'Donnell, head of the Home Civil Service and Cabinet Secretary.
Before she left, Sir Gus said the meeting of permanent secretaries the Queen had joined had discussed "a whole range of challenges facing government".
The topics included the economy, constitutional reform and arrangements for the visit of the Pope in the autumn.
Sir Gus went on to praise the efforts of the Royal Household during the coalition talks and acknowledged Mr Geidt's work, and that of others.
He added: "No fewer than 12 prime ministers have had the privilege of being asked to form a government by Your Majesty but the current prime minister is the first to form a coalition government during your reign and I would like to pay tribute to your own staff who have played a crucial role in supporting that transition."
Among those introduced to the Queen were the officials who run her birthday and New Year honours lists.
The names of those who will receive knighthoods, CBEs, MBEs and other awards will be announced tomorrow, on the day the Queen celebrates her official anniversary with the Trooping the Colour ceremony.