LONDON — Britain’s carefully choreographed political change of command culminated Wednesday with Theresa May inheriting the reins of a country caught in an unaccustomed vortex of uncertainty as it hurtles toward an exit from the European Union.
May was invited to govern the country during an audience with Queen Elizabeth II only minutes after David Cameron visited Buckingham Palace and formally resigned as prime minister.
A photo of May curtsying before a handbag-toting queen signaled the moment that May formally ascended to the country’s highest political office.
Minutes later, in her first address outside 10 Downing Street, May delivered a short but striking statement that sketched out her vision as Britain’s first female leader since Margaret Thatcher.
May departed from typical Conservative rhetoric and vowed to fight the “burning injustice” that she said has harmed minorities and women. She also promised to serve the poor and the working class.
Although she did not delve deeper than broad strokes, May emphasized bright horizons for Britain outside the European Union in contrast to gloomy forecasts from those who consider the referendum outcome a monumental mistake.
“As we leave the European Union, we will forge a bold, new, positive role for ourselves in the world, and we will make Britain a country that works not for a privileged few but for every one of us,” said May, who had leaned toward the pro-E.U. side before last month’s vote on Britain’s E.U. future.
She also said she would vigorously defend the “precious bond of the United Kingdom,” a nod to her determination to beat back a revitalized secessionist movement in Scotland driven by opposition to the decision to leave the European Union.
After May spoke, she immediately went to work, inviting top Tory politicians to Downing Street to accept jobs in her cabinet.
Boris Johnson, the former London mayor and leading Brexit advocate, was named foreign secretary, making the flamboyant leader the country’s top diplomat. The appointment came less than two weeks after Johnson’s ambitions to take the country’s top job were dashed by the last-minute entrance into the race of the man who was to be his campaign manager, Michael Gove.
Philip Hammond, who had been the foreign secretary, will now be the country’s top finance official as chancellor of the exchequer.
George Osborne, formerly the chancellor and once considered the most likely man to succeed Cameron as prime minister, resigned from the government in the reshuffle.
Amber Rudd, the energy and climate change secretary, was named to May’s old job: home secretary. May had earlier indicated she would appoint women to top posts.
Earlier Wednesday, Cameron went through his final, mostly ceremonial, paces as leader.
He received a standing ovation in Parliament, and he declared Britain “much stronger” than when he took office six years ago as he left Downing Street for the last time as prime minister.
Amid gusting winds and bursts of rain, Cameron gave a short statement outside the prime minister’s residence with his wife and three young children by his side. He thanked the country for the “greatest honor of my life” and wished his successor luck guiding Britain through its difficult E.U. split.
It was Cameron’s bad bet on the E.U. — in calling a referendum that he lost — that set off Wednesday’s transition, just a year after Cameron won a resounding victory that could have kept him in office until 2020.
When he appeared on the green benches of Parliament earlier Wednesday, Cameron took some jabs from opponents who blamed him for calling that vote. He was also cheered by supporters, and his premiership was celebrated by fellow Conservatives who congratulated him on cutting the deficit, enacting gay marriage and appointing women to key posts — one of whom took his place.
May became the 13th prime minister to air-kiss the hand of Queen Elizabeth II, who at 90 has seen leaders of government come and go on average every five years during her six-decade-plus reign.
But amid the pomp and circumstance was the serious business of a nation facing the gravest challenge to its identity since it shed its empire.
May, 59, is handed a daunting task from the 49-year-old Cameron that neither wanted: taking the country out of the European Union.
May, who is just the second female prime minister in British history after Thatcher, won the job on Monday after her sole rival, Andrea Leadsom, unexpectedly dropped out. May had already won the first round of voting — among Conservative members of Parliament — last week. With only one candidate in the race, a planned summer-long vote of rank-and-file party members was called off.
May takes the keys to 10 Downing Street after six years directing the country’s domestic security as home affairs secretary.
In that time, she developed a reputation as a steely yet cautious manager. Colleagues have described her as tough-minded and well-briefed on her portfolio of issues, which included the fight against Islamist extremist violence and policing of the country’s borders.
She has been a hawk on the need to cut immigration and had pushed for a greater government role in electronic surveillance.
Her views on foreign and economic policy are less known. But in her first major speech on the economy this week, her tone was more liberal than expected — emphasizing the need for growing the economy, rather than cutting government spending.
On foreign policy, she has taken a hard line on containing Russia and China. She has also worked closely with colleagues across Europe and in Washington on counterterrorism efforts as Westerners have flocked to Syria to fight alongside the Islamic State.
Supporters laud her resolve and her experience. Detractors depict her as stubborn and rigid.
“She’s the best of a bad bunch,” Vince Cable, a Liberal Democrat who worked alongside May as business secretary before last year’s general election, told the BBC.
May’s first hours in office include briefings by top advisers on the most pressing problems facing the country. She will also be asked to write, by hand, a “letter of last resort” — the orders given to the commander of Britain’s nuclear-armed Trident submarines to be carried out in the event that London is obliterated by an attack and the prime minister is killed. She will have to decide whether her orders are to retaliate, surrender or something in between.
But it is the British exit from the European Union — Brexit — that looms largest.
During the country’s referendum campaign, she was a reluctant advocate for staying in the 28-member bloc.
Since last month’s vote, however, she has repeatedly insisted that the voters’ will should be honored and that “Brexit means Brexit.”
One of her first major decisions as prime minister will be to choose when to begin negotiations. Before her victory was assured Monday, she had said that she would not trigger Article 50 — the never-before-used mechanism for exiting the European Union — before year’s end. But she is likely to come under pressure from European leaders across the English Channel and from Brexit advocates at home to accelerate that timetable.
Once the process has begun, Britain will have just two years to negotiate its way out of the bloc. The time frame is considered short for such a complicated untangling. Foreign Secretary Philip Hammond told Parliament this week that, in reality, it may take as long as six years.
It all could be moving too fast for British strategy-crafters. Cameron announced his plans to resign soon after the vote, having failed to persuade the country to take his advice and stick with the E.U. despite its flaws. His government had no real plans for what to do the day after a Brexit vote.
A key May lieutenant, Chris Grayling, told the BBC on Wednesday that “we should not rush into triggering Article 50” and that “preparatory work” was still needed before the talks with Europe could begin.
For Cameron, Wednesday represents the disappointingly abrupt end to a premiership that has stretched six years — but was supposed to last as many as 10.
He won office having promised to modernize the Conservative Party and to rescue a then-struggling economy.
His backers say he succeeded on both counts: He pushed through the legalization of gay marriage, a measure that proved the Conservatives could embrace socially liberal positions. And amid steep cuts to government spending, he oversaw a slow but steady expansion of the economy after taking over a country still mired in the aftershocks of global recession.
But Cameron lost his biggest gamble: He had hoped to end a decades-long rift in the country, and especially within his party, between opponents and critics of the E.U. with a national endorsement of the nation’s membership.
Last month’s narrow loss — 52 percent to 48 percent — means he will likely be remembered instead as the prime minister who unintentionally led the country into a messy break with Europe. That outcome could also sever the bonds of the United Kingdom, with Scotland threatening to secede if Britain leaves the European Union.
But Cameron received a generally warm farewell from lawmakers. Customarily a gladiatorial-style grudge match, the weekly Prime Minister’s Questions becomes a nostalgia-tinged farewell when a leader appears for the final time.
Standing two sword lengths from opposition leader Jeremy Corbyn, Cameron said he had taken 5,500 questions during his six years, though in his typically jocular style, he added that he would “leave it to others to work out how many I’ve answered.”
The two party leaders also engaged in some final jousting. Cameron described Corbyn, who has stubbornly refused to step down despite losing widespread support, as “the Black Knight in Monty Python,” who loses limb after limb while insisting that “it’s only a flesh wound.”
Cameron concluded on a tender note, saying he would “miss the roar of the crowd” and would be “willing all of you on.”
“You can achieve a lot of things in politics. You can get a lot of things done,” said Cameron, who will now take a place among the Conservative Party members in Parliament’s back benches. “And that in the end — the public service, the national interest — that is what it is all about.”
His final line referenced a barb he once directed at one of his predecessors, Tony Blair: “I was the future once,” the still-youthful-looking leader said.