Former prime minister Margaret Thatcher, the controversial "Iron Lady" who shaped a generation of British politics and was a pivotal figure in the Cold War, died following a stroke on Monday. She was 87.

Queen Elizabeth II and former Soviet president Mikhail Gorbachev led tributes to Thatcher, who was Britain's only woman premier, while current Prime Minister David Cameron cut short a trip to Europe following her death.

Thatcher will receive a ceremonial funeral with military honours, the same as Diana, princess of Wales, received but a step short of the full state funeral of the kind accorded to monarchs and World War II premier Winston Churchill.

"It was with great sadness that I learned of the death of Lady Thatcher. We have lost a great leader, a great prime minister and a great Briton," Cameron said.

Thatcher, who led Britain from 1979 to 1990, suffered from dementia and appeared rarely in public in recent years. She was last in hospital in December for a minor operation to remove a growth from her bladder.

The former Conservative Party leader was the 20th century's longest continuous occupant of Downing Street.

AS her health worsened, the former premier had to be repeatedly reminded that her husband Denis had died in 2003, her daughter once revealed.

Thatcher was told by doctors to quit public speaking a decade ago after a series of minor strokes.

"It is with great sadness that Mark and Carol Thatcher announced that their mother Baroness Thatcher died peacefully following a stroke this morning," her spokesman Lord Tim Bell said, referring to Thatcher's children.

Britain's 86-year-old queen, who shared weekly chats with Thatcher during her 11 years in power, also paid tribute.

"The Queen was sad to hear the news of the death of Baroness Thatcher. Her Majesty will be sending a private message of sympathy to the family," Buckingham Palace said.

Downing Street said that with the queen's consent Thatcher would receive a "ceremonial funeral with military honours" with the service taking place at St Paul's Cathedral in central London.

A private cremation would follow later, it said.

Cameron was meanwhile flying back to London from Madrid where he had been in talks with Spanish premier Mariano Rajoy on reforming the European Union, while a visit to Paris to meet President Francois Hollande had also been cancelled, Downing Street later said.

"Yes, he is cutting short his trip. He's returning from Madrid, he's expected back later today," a spokesman told AFP.

Flags were flying at half-mast over the Houses of Parliament and Downing Street, the prime minister's official residence.

Right-wingers hailed Thatcher as having hauled Britain out of the economic doldrums but the left accused her of dismantling traditional industry, claiming her reforms helped unpick the fabric of society.

Ed Miliband, leader of the opposition Labour Party which loathed Thatcher during her decade in office, said his party "disagreed with much of what she did" but hailed her "political achievements and her personal strength".

On the world stage, Thatcher built a close "special relationship" with US president Ronald Reagan which helped bring the curtain down on Soviet Communism. She also fiercely opposed closer political ties with Europe.

Gorbachev, whose good relations with Thatcher played a part in the end of the Cold War, said she would have a place in history.

"Margaret Thatcher was a great politician and a bright individual. She will go down in our memory and in history," the Nobel Peace Prize winner, who held frequent meetings with Thatcher at the end of the Cold War, told the Interfax news agency.

European Commission head Jose Manuel Barroso meanwhile hailed her "contributions" to the growth of the EU, despite her famous reservations about continental European integration.

Thatcher was born Margaret Hilda Roberts on October 13, 1925 in the market town of Grantham, eastern England, the daughter of a grocer.

After grammar school and a degree in chemistry at Oxford University, she married businessman Denis in 1951 and two years later had twins, Carol and Mark.

She was first elected to the House of Commons in 1959 and succeeded former prime minister Edward Heath as opposition Conservative leader in 1975 before becoming premier four years later.

Her enduring legacy can be summed up as "Thatcherism" -- a set of policies which supporters say promoted personal freedom and broke down the class divisions that had riven Britain for centuries.

Pushing her policies through pitched Thatcher's government into a string of tough battles, while she also had to deal with unexpected setbacks.

When Argentina invaded the remote British territory of the Falkland Islands in 1982, Thatcher dispatched troops and ships, securing victory in two months.