Margaret Thatcher was laid to rest on Wednesday with military pageantry and pockets of protests, in a funeral reflecting the polarising impact of Britain's longest serving post-war prime minister.
Queen Elizabeth II led mourners from the British establishment and 170 different countries in bidding farewell to the Iron Lady, who transformed Britain and is credited with helping end the Cold War.
Tens of thousands of people gathered to watch the procession through London to St Paul's Cathedral, led by a military band, and many broke into spontaneous applause and threw flowers as the coffin passed by.
But several hundred protesters turned their backs and booed, proof of the bitterness that remains over her legacy.
Thatcher, Britain's only female prime minister, who served from 1979 to 1990, died last week aged 87 after suffering a stroke.
Her flag-draped coffin was transported through streets lined with 700 soldiers, sailors and airmen in full ceremonial uniform, carried first in a hearse and then in a World War I-era gun carriage drawn by six black horses.
Supporters say Thatcher's radical free-market reforms saved Britain from economic decline, but critics say they left millions of people out of work and created a culture of greed.
The police had deployed 4,000 officers for the event amid heightened security following the bombings at the Boston Marathon and fears of disruption by left-wing groups.
At one section of the procession, the applause was drowned out by chants of "Maggie, Maggie, Maggie! Scum, scum, scum!", although the protest passed off peacefully without any arrests.
At the cathedral, the queen and Prince Philip led the 2,300 mourners in a rare tribute from the monarch, who had not attended a prime ministerial funeral since Winston Churchill died in 1965.
Prime Minister David Cameron, leader of Thatcher's Conservative party, joined politicians from across the political spectrum including former premiers John Major, Tony Blair and Gordon Brown.
Global figures including Thatcher's fellow Cold War warrior Henry Kissinger, the former US secretary of state, and showbusiness stars Joan Collins and Shirley Bassey also attended.
Sitting at the front were Thatcher's twin children Mark and Carol, 59, who had left a note on the white flowers adorning the coffin which read simply: "Beloved Mother -- Always in Our Hearts".
In his address, Bishop of London Richard Chartres acknowledged the debate that still rages over Thatcher's legacy but said her funeral was no place for politics.
"After the storm of a life led in the heat of political controversy, there is a great calm," he said.
"The storm of conflicting opinions centres on the Mrs Thatcher who became a symbolic figure -- even an -ism. Today the remains of the real Margaret Hilda Thatcher are here at her funeral service."
-- The 'best prime minister since Churchill' --
Many people had risen at dawn to travel to London for the funeral.
"I wanted to pay my respects to the best prime minister since Churchill," said Gloria Martin, a property developer in her 60s with an array of "I Love Maggie" badges pinned to her chest.
"She was strong, she was resolute, and she put her country first above any idea of popularity."
The crowd included veterans of the Falklands war, viewed by many of her admirers as Thatcher's finest hour.
Servicemen from units that fought in the 1982 conflict with Argentina carried the coffin into St Paul's, while two brothers who served in the war walked behind.
The islands, which recently voted overwhelmingly to stay British in a referendum, were planning their own memorial to Thatcher.
Argentina was pointedly not represented at St Paul's, where the guests included the prime ministers of Canada, Israel, Italy, Poland and Kuwait.
The scale of the funeral -- paid for with millions of pounds of public money -- has sparked criticism from those who argue that Thatcher was too divisive to merit such a state-sponsored send-off.
"We're spending £10 million (11.7 million euros, $15.3 million) on it and that's disgraceful and unacceptable at a time of austerity," said 22-year-old student Casper Winslow, one of those who turned his back to the coffin.
The protests took a more macabre turn in Goldthorpe in northern England, which like many of Britain's former mining communities was destroyed by coal pit closures under Thatcher's government.
An effigy of the former premier was paraded inside an open wooden coffin before being burned, while another hung from the roof of a social club, watched gleefully by drinkers outside.
The government has yet to disclose the costs of the funeral but insists it will be less than the reported £10 million.
Cameron insisted it was right to give Thatcher a proper farewell.
"It is a fitting tribute to a great prime minister respected around the world," he told BBC radio.
"And I think other countries in the world would think Britain got it completely wrong if we didn't mark this in a proper way."
The service included Christian hymns reflecting her strict Methodist upbringing and Bible readings by Cameron and Thatcher's granddaughter Amanda, followed by a blessing from the Archbishop of Canterbury, Justin Welby.
Her body was to be cremated in a private family ceremony later on Wednesday at Mortlake in southwest London.