Grey skies and rain greeted Queen Elizabeth II's coffin as it was brought back to London on a military transport plane on Tuesday, before Britain says a final farewell to its longest-serving monarch.

The giant C-17 Globemaster plane, using the callsign "Kittyhawk" to signal the queen's presence on board, touched down from Edinburgh at Royal Air Force base Northolt at 6:54 pm (1754 GMT).

The queen's heavy lead-lined oak coffin, draped in the royal standard, was transferred slowly by eight RAF pallbearers into a waiting state hearse for the journey back to Buckingham Palace.

Despite the weather, crowds along the route into central London had built steadily through the day, and outside the palace gates, to catch a glimpse of the coffin.

Queen Elizabeth II died last Thursday aged 96 at her Balmoral retreat in the Scottish Highlands, after almost a year of ill-health that saw her gradually retreat from public view.

Her body was brought first to the monarch's official residence in Scotland, the Palace of Holyroodhouse, in Edinburgh on Sunday, then transferred to St Giles' Cathedral in the city on Monday.

The Scottish government said some 33,000 people filed past her coffin overnight to Tuesday afternoon, before it was taken to the airport.

Accompanying the coffin on the plane, as she did from Balmoral to Edinburgh by road, was her only daughter, Princess Anne, who said it had been "an honour and privilege" to do so.

"To my mother, The Queen, thank you," the 72-year-old Princess Royal said in a statement.

Outside St Giles' Cathedral, the Royal Company of Archers, the monarch's bodyguard in Scotland, formed a guard of honour as the coffin emerged to the haunting sound of a lone piper.

At Edinburgh Airport, the Royal Regiment of Scotland, in ceremonial kilts, also formed a guard of honour to the woman dubbed "Queen of Scots", and the national anthem was played as the plane taxied to the runway.