The right-wing former prime minister whom the Soviet Union christened the "Iron Lady" was bid farewell with military honours, patriotic hymns, cheers and tears.
Her coffin was borne on a horse-drawn gun carriage then soldiers and sailors carried her casket into St. Paul's Cathedral for a service attended by Queen Elizabeth and 11 serving prime ministers from around the world.
Outside, thousands of supporters lined the route, some throwing blue roses in her path.
Opponents chanted "Ding dong the witch is dead" and turned their backs on her coffin as it passed by - an indication of the divisions which Britain's longest serving prime minister of the 20th Century still provokes due to the tumultuous change she brought.
Thatcher sought to arrest Britain's post-war decline with free-market economic policies which enraged her left-wing opponents by smashing the unions and privatising Britain's national assets.
Her supporters view her as a champion of freedom while her opponents accuse her of destroying communities and ushering in an era of greed.
"The storm of conflicting opinions centres on the Mrs Thatcher who became a symbolic figure, even an ism, but today the remains of the real Margaret Hilda Roberts are here at her funeral service," the Bishop of London, Richard Chartres, told mourners gathered inside St Paul's.
Tears ran down the face of Britain's finance minister George Osborne during the address.
The cleric brought smiles to the faces of former leader Tony Blair, Cameron's wife Samantha and other mourners when he recounted a story about her telling him not to eat duck pate because it was fattening.
Cameron and Amanda, Thatcher's 19-year old granddaughter, read from the New Testament while patriotic hymns echoed around the ornately decorated dome of the 300-year-old cathedral.
The service was attended by 2,300 mourners including former British prime ministers and the government's entire cabinet, two heads of state and 17 foreign ministers. Former U.S. Secretary of State Henry Kissinger also attended.
The music included her favourite hymns, among them "I Vow to Thee My Country".
Thousands of supporters lined the streets of London as her casket made its final journey from the centre of British political power in Westminster to the cathedral. Most people clapped in respect but about two dozen opponents turned their backs on the procession.
One man held up a placard reading "Boo!" and some shouted "scum" while supporters threw flowers and cheered.
Thatcher, who governed Britain from 1979 to 1990, died on April 8 aged 87 after suffering a stroke.
Polls have shown that many Britons are unhappy that the estimated 10-million pound bill for the ceremonial funeral is being picked up by the taxpayer at a time of austerity and spending cuts.
The late leader was honoured with a gun salute from the Tower of London every minute and the silencing of the Big Ben bell at the Houses of Parliament.
British military bandsmen played Beethoven, Mendelssohn and Chopin to accompany the grandest funeral for a British politician since that of Thatcher's hero, Winston Churchill, in 1965.
"She was the first woman prime minister, she served for longer in the job than anyone for 150 years, she achieved some extraordinary things in her life," said Cameron, current leader of the Conservative Party.
"What is happening today is absolutely fitting and right," he said, dismissing the critics.
A handwritten note placed on a wreath of white flowers on her coffin read: "Beloved mother - always in our hearts".
More than 700 armed forces personnel from units that served in the 1982 Falklands War against Argentina - Thatcher's most emblematic victory - lined the streets. Police also stood all along the route.
People gathered along the funeral procession route early in the morning with placards that reflected a range of views.
"You gave millions of us hope, freedom, ambition," read one. Another said: "Over 10 million pounds of our money for a Tory funeral". Tory is another word for Conservative.
"This country was pretty well down on its knees in the seventies," said Roger Johnson, among the admirers lining the pavement in central London.
"Margaret Thatcher came along and sorted everything out. Her legacy is that she put the word "great" back into Great Britain," he said.
Argentinians stay away
There were notable absences. Former Soviet leader Mikhail Gorbachev and Nancy Reagan, the widow of Thatcher's great US friend and ally Ronald Reagan, were too frail to attend.
Thatcher struck up a close relationship with Reagan during the Cold War and was among the first to decide that Gorbachev was a man she could "do business with".
The guest list for her funeral has prompted talk of diplomatic snubs. The United States did not send a senior figure from President Barack Obama's administration.
Argentina's ambassador refused to attend after Britain failed to invite Argentinian President Cristina Fernandez, at the Thatcher family's request, amid renewed tensions over the Falkland Islands.
Relations have been strained since the 1982 war, when Thatcher ordered a task force to retake the South Atlantic territory after Argentinian troops seized it.
The abiding domestic images of her premiership will remain those of conflict - police confrontations with massed ranks of coalminers whose year-long strike failed to save their pits and communities, Thatcher riding a tank in a white headscarf, and flames rising above Trafalgar Square in riots over the unpopular "poll tax" which contributed to her downfall.
Cameron said Thatcher's battles, particularly her crushing of strike-prone trade unions, had reduced divisions.
"She was a bold politician who recognised the consensus was failing...She took tough and necessary decisions and in many ways created a new consensus," he said.
Even Thatcher's critics concede that, for better or for ill, she transformed the face of Britain.
In 1979, when she came to power, Britain was in the grip of a long post-war decline with troubled labour relations and low productivity and was being outperformed by continental rivals France and Germany.
She turned that around by boosting home ownership and the service industry, breaking the power of the unions, and deregulating financial services.
But the price - growing inequality and the closure of large swathes of Britain's industrial base - left parts of the country struggling to create new jobs and rebuild decimated communities, leaving a bitter taste which endures.