LONDON (AP) - King Charles III vowed in his first speech as monarch Friday to carry on Queen Elizabeth II's “lifelong service” with his own modernizing stamp, as Britain entered an uncertain new age under a new sovereign. Around the world, the queen's exceptional reign was commemorated, celebrated and debated.

Charles, who spent much of his 73 years preparing for the role of king, addressed a nation grieving the only British monarch most people alive today had ever known. He takes the throne in an era of unease for both his country and the monarchy itself.

He spoke of his “profound sorrow” over the death of his mother, calling her “an inspiration and example to me and to all my family.”

“That promise of lifelong service I renew to all today,” he said in the 9 1/2-minute address, recorded earlier in the day and delivered with a framed photo of the queen on a desk in front of him.

“As the queen herself did with such unswerving devotion, I, too, now solemnly pledge myself, throughout the remaining time God grants me, to uphold the constitutional principles at the heart of our nation,” he said.

The king's speech was broadcast on television and streamed at St. Paul's Cathedral, where some 2,000 people attended a service of remembrance for the queen. They included Prime Minister Liz Truss and officials in her government, along with hundreds of members of the public who lined up for tickets.

As the country began a 10-day mourning period, people around the globe gathered at British embassies to pay homage to the queen, who died Thursday at Balmoral Castle in Scotland after an unprecedented 70 years on the throne.

In London and at military sites across the United Kingdom, cannons fired 96 shots in an elaborate, 16-minute salute marking each year of the queen's life.

The widespread admiration for Elizabeth in Britain and across its former colonies was occasionally mixed with scorn for the institution and the imperial history she symbolized.

Charles, who became the monarch immediately upon his mother's death, will be formally proclaimed king at a ceremony on Saturday. He is expected to tour the United Kingdom in the coming days.

The queen's coffin will be brought to London, where she will lie in state before a funeral at Westminster Abbey, expected around Sept. 19.

On the king's first full day of duties, Charles left Balmoral and flew to London for a meeting with Truss, appointed by the queen just two days before her death.

He arrived at Buckingham Palace, the monarch's London home, for the first time as sovereign, emerging from the official state Bentley limousine alongside Camilla, the queen consort, to shouts from the crowd of “Well done, Charlie!” and the singing of the national anthem, now called “God Save the King.” One woman gave him a kiss on the cheek.

Under intense scrutiny and pressure to show he can be both caring and regal, Charles walked slowly past flowers heaped at the palace gates for his mother. The mood was both grieving and celebratory.

“It has been so touching. ... All those people, come to give their condolences,” he told Truss during their meeting.

“It's the moment I've been dreading, as I know a lot of people have,” he added, referring to his mother's death. “But you try and keep everything going.”

The changing of the guard comes at a time when many Britons are facing an energy crisis, the soaring cost of living, the war in Ukraine and the fallout from Brexit.

In his speech, Charles looked to both the past - noting his mother's unwavering “dedication and devotion as sovereign” - and the future, seeking to strike a reassuring note of constancy while signaling that his will be a 21st-century monarchy.

He reflected on how the country had changed dramatically during the queen's reign into a society “of many cultures and many faiths,” and pledged to serve people in Britain and the 14 other countries where he is king “whatever may be your background or beliefs.”

The lifelong environmentalist said he was confident work on “the issues for which I care so deeply” would “go on in the trusted hands of others.”

He spoke of his son Prince William, now heir to the throne and formally given the title that Charles long held, Prince of Wales. William and his wife, Catherine, Princess of Wales, will “continue to inspire and lead our national conversations, helping to bring the marginal to the center ground where vital help can be given,” Charles said, referring to the couple's work on homelessness, mental health and other issues.

He also struck a note of reconciliation after a raw family rift when he said, “I want also to express my love for Harry and Meghan as they continue to build their lives overseas.”

Prince Harry and wife Meghan have been in a tense relationship with the royal family since they stepped away from their official duties and left the country in 2020, citing what they said were the unbearable intrusions and racist attitudes of the British media toward the biracial American actress.

As the second Elizabethan Age came to a close, throngs of people arrived all day to grieve together and lay flowers outside the gates of Buckingham Palace and other royal residences.

Finance worker Giles Cudmore said the queen had “just been a constant through everything, everything good and bad.”

At Holyrood Palace in Edinburgh, mourner April Hamilton stood with her young daughter, struggling to hold back tears.

“It's just such a momentous change that is going to happen,” she said. “I'm trying to hold it together today.”

Many sporting and cultural events were canceled as a mark of respect, and some businesses - including Selfridges department store and the Legoland amusement park - shut their doors. The Bank of England postponed its meeting by a week.

Elizabeth was Britain's longest-reigning monarch and a symbol of constancy in a turbulent era that saw the decline of the British empire and upheaval in her family, including the messy divorce of Prince Charles and Princess Diana.

The public's affection for the queen had helped sustain support for the monarchy amid complaints in some quarters that it had outlived its usefulness. But Charles does not command that kind of popularity.

“Charles can never replace her, you know,” said 31-year-old Londoner Mariam Sherwani.

Like many, she referred to Elizabeth as a grandmother figure. Others compared her to their mothers, or great-grandmothers.

But around the world, her passing revealed conflicting emotions about the nation and institutions she represented.

In Ireland, some soccer fans cheered.

For some, Elizabeth was a queen whose coronation glittered with shards of a stunning 3,106-carat diamond pulled from grim southern African mines, a monarch who inherited an empire they resented. Across Africa, nations rejected British rule and chose independence in her first decade on the throne.

In India, once the “jewel in the crown” of the British empire, entrepreneur Dhiren Singh described his own personal sadness at her death, but added: “I do not think we have any place for kings and queens in today's world.”

Associated Press writer Cara Anna in Nairobi, Kenya, and AP journalists from around the world contributed to this report.