The palace confirmed in a brief, formal statement that "the Right Honorable David Cameron MP had an Audience of The Queen this evening and tendered his resignation as Prime Minister and First Lord of the Treasury, which Her Majesty was graciously pleased to accept".
She promised to lead a "one-nation" government dedicated to social justice and making "Britain a country that works for everyone".
"The government I lead will be driven not be the interests of the privileged few, but by yours.
And I wish her well in negotiating the best posible terms for Britain's exit from the European Union".
In his last words in front of Downing Street he said "We've not got every decision right...but our economy is immeasurably stronger".
"Following the referendum [to leave the EU], we face a great national challenge".
But the mission to make Britain a country that works for everyone means more than fighting these injustices.
In his final Prime Minister's Questions session in the House of Commons, Cameron said he would "miss the roar of the crowd and the barbs from the opposition" that came with the job over the past six years.
Cameron - stepping down after losing the June Brexit referendum - praised May as a "brilliant negotiator". "If you're from an ordinary working class family, life is much harder than many people in Westminster realise".
Mr Cameron had earlier given his final speech as prime minister outside Number 10, saying the job had been "the greatest honour" of his life and that the United Kingdom was "much stronger" than when he took over.
May emphasized her commitment to delivering Brexit but "explained that we would need some time to prepare for these negotiations and spoke of her hope that these could be conducted in a constructive and positive spirit", the spokeswoman said of the calls.
On leaving the prime minister's Downing Street office, Johnson immediately got into a ministerial vehicle and went to speak to staff at the Foreign Office.
May, who had supported Britain's continued European Union membership, moved quickly to heal divisions sparked by the referendum by appointing leading "Leave" campaigner Johnson to a senior cabinet post.
Mrs May is the UK's second female prime minister, after Margaret Thatcher.
May has run Britain's home office for six years, dealing with policing, immigration and other tough issues.
May stressed that the full name of the Tory party included the word "unionist" and she meant to try to keep the country together after a clear majority of voters in Scotland and Northern Ireland rejected withdrawal from the European Union in the referendum.
Earlier Wednesday, Cameron took questions from members of Parliament at the House of Commons, which ended in a standing ovation from lawmakers.
Mrs May is the 13th Prime Minister during the reign of Queen Elizabeth II.
Mrs May's elevation completes a whirlwind rise to the country's most senior political job triggered by the unexpected Brexit vote in last month's referendum which brought down her predecessor David Cameron just 20 days ago.