LONDON (AP) — Margaret Thatcher was laid to rest Wednesday with prayers and ceremony, plus cheers and occasional jeers, as Britain paused to remember a leader who transformed the country — for the better according to many, but in some eyes for the worse.

Soaring hymns, Biblical verse and fond remembrances echoed under the dome of St. Paul's Cathedral, as 2,300 relatives, friends, colleagues and dignitaries attended a ceremonial funeral for Britain's only female prime minister.

Queen Elizabeth II, current and former prime ministers and representatives from 170 countries were among the mourners packing the cathedral, where Bishop of London Richard Chartres spoke of the strong feelings Thatcher still evokes 23 years after leaving office.

"The storm of conflicting opinions centers on the Mrs. Thatcher who became a symbolic figure — even an -ism," he said. "It must be very difficult for those members of her family and those closely associated with her to recognize the wife, the mother and the grandmother in the mythological figure."

"There is an important place for debating policies and legacy ... but here and today is neither the time nor the place," he added.

Security for the funeral — the largest in London for more than a decade — was tightened after bombings at the Boston Marathon on Monday killed three people and wounded more than 170.

More than 700 soldiers, sailors and air force personnel formed a ceremonial guard along the route taken by Thatcher's coffin to the cathedral, and around 4,000 police officers were on duty.

But while thousands of supporters and a smaller number of opponents traded shouts and arguments, there was no serious trouble. Police said there were no arrests, and the only items thrown at the cortege were flowers.

Before the service, Thatcher's coffin was driven from the Houses of Parliament to the church of St. Clement Danes, about half a mile (0.8 kilometers) from the cathedral, for prayers.

From there the coffin — draped in a Union flag and topped with white roses and a note from her children Mark and Carol reading "Beloved mother, always in our hearts" — was borne to the cathedral on a gun carriage drawn by six black horses.

Spectators lining the route broke into applause as the carriage passed by, escorted by young soldiers, sailors and airmen. A few demonstrators staged silent protests by turning their backs on Thatcher's coffin, and one man held a banner declaring "rest in shame."

An honor guard of soldiers in scarlet tunics and bearskin hats saluted the coffin as it approached St. Paul's, while red-coated veterans known as Chelsea Pensioners stood to attention on the steps.

Guests inside the cathedral included Thatcher's political colleagues, rivals and her successors as prime minister: John Major, Tony Blair, Gordon Brown and David Cameron.

Former U.S. Secretary of State Henry Kissinger and former Vice President Dick Cheney were among the American dignitaries, while notable figures from Thatcher's era included F.W. de Klerk, the last apartheid-era leader of South Africa; former Polish President Lech Walesa; ex-Canadian Prime Minister Brian Mulroney; and entertainers such as "Dynasty" star Joan Collins, singer Shirley Bassey and composer Andrew Lloyd Webber.

Thatcher's tenure coincided with — and influenced — the fall of the Berlin Wall and the "Reagan revolution" in the United States. Former U.S. first lady Nancy Reagan and onetime Soviet leader Mikhail Gorbachev, both invitees with close ties to Thatcher's leadership, were kept away from the funeral by age. Argentine Ambassador Alicia Castro declined an invitation amid continuing acrimony over the 1982 Falklands War.

The ceremony was traditional, dignified and very British. Mourners entered to music by British composers, including Edward Elgar and Ralph Vaughan Williams, and the service featured hymns and readings chosen by Thatcher, who grew up as a grocer's daughter in a hard-working Methodist household.

There was a passage from T.S. Eliot, a section of Gabriel Faure's "Requiem" and the patriotic hymn "I Vow to Thee, My Country."

The late leader's 19-year-old granddaughter Amanda Thatcher read a passage from Ephesians: "Stand therefore, having your loins girt about with truth, and having on the breastplate of righteousness."

It was a classic Thatcher image, capturing what people loved and loathed about a leader full of strength and certainty.

The dean of St. Paul's, David Ison, recalled "her courage, her steadfastness and her resolve to accomplish what she believed to be right for the common good."

Afterward, the crowd gathered outside cheered and applauded as Thatcher's coffin was carried out to the half-muffled peal of the cathedral bells. The former prime minister will be cremated, in keeping with her wishes.

The woman nicknamed the Iron Lady brought major change to Britain during her 11-year tenure from 1979 to 1990, privatizing state industries, deregulating the economy, and causing upheaval whose impact is still felt. She died April 8 at age 87.

Thatcher was given a ceremonial funeral with military honors — not officially a state funeral, which requires a vote in Parliament — but proceedings that featured the same level of pomp and honor afforded Princess Diana in 1997, and Queen Mother Elizabeth in 2002.

That raised the ire of some Britons who believe her legacy is a socially and economically unequal nation.

"She divided the country," said Glynn Jones, a taxi driver from Liverpool, a city devastated in Thatcher's time by industrial decline. He said he had come to smoke a cigar, watch the procession go by and "double-check that she is dead and it is not a con."

Protests were held in northern England mining towns devastated by the closure of Britain's coal pits after a bitter strike while Thatcher was prime minister.

In the town of Goldthorpe, an effigy of the late prime minister was strung up outside the Union Jack social club, and a replica coffin — adorned with a floral wreath spelling "scab," or strikebreaker — was burned on a pyre.

"I'm not a bitter man. I don't hate people. But I have no feelings for her," said former miner Tony Hiles. "I couldn't care less that she's died."

But in London, hundreds of people packed the area around the cathedral to say goodbye to a leader they admired.

"I came to commemorate the greatest hero of our modern age," said 25-year-old Anthony Boutall, clutching a blue rose. "She took a nation on its knees and breathed new life into it."