May will be Britain's second female prime minister, following in the footsteps of Margaret Thatcher, her fellow Conservative with whom she has inevitably been compared.
"My advice to my successor, who is a brilliant negotiator, is that we should try to be as close to the European Union as we can be, for the benefits of trade, of co-operation and of security", he said in parliament, with May sitting beside him.
"We will rise to the challenge", May said outside 10 Downing Street following her appointment by Queen Elizabeth on Wednesday evening. It also reinforces a promise she made outside 10 Downing St. on Wednesday: "We will make Britain a country that works not for a privileged few, but for every one of us".
One can only hope then that the Brexit is indeed successful and there are no major repercussions for Britain, a country from which we source the majority of our visitors and which is also a major trading partner.
Cameron resigned after Britain's narrow vote in the referendum of June 23 to leave the EU.
Earlier, at Prime Minister's Questions - a weekly session, Cameron said May was "a brilliant negotiator".
Cameron stepped down after Britons rejected his entreaties and voted in a June 23 referendum to quit the European Union, weakening the 28-nation bloc and creating huge economic uncertainty because of the likely damage to trade and investment.
But European Commission president Jean-Claude Juncker insisted the issue must be addressed "soon", a sentiment echoed by French President Francois Hollande in his call with May.
Although she favoured Britain remaining in Europe, Ms May has repeatedly declared that "Brexit means Brexit" and that there can be no attempt to reverse the referendum outcome.
"She doesn't like to rush into decision, she listens to everybody, that was her style of leadership in the interior ministry - there is no reason to change", he said.
Cameron also stressed his love for Larry, the Downing Street cat - amid rumours that he was not a fan - a point he later emphasised on Twitter and swapped warm wishes with Jeremy Corbyn, saying he had nearly come to admire the Labour leader's "tenacity" in hanging on to his job.
"It's not been an easy journey and of course we've not got every decision right".
Cameron then headed to Buckingham Palace to formally give his resignation as prime minister to Queen Elizabeth II.
European Union leaders, still reeling from Britain's decision to become the first country to leave the bloc in its 60-year history, pressed May for a quick divorce. He gambled, and he lost.
He began his day with his weekly Prime Minister's Questions in the House of Commons for the 182nd and final time as PM, at the end of which he was bid farewell by British MPs from across party lines with a round of applause.
"As I once said, I was the future once", Cameron noted, as his wife and children watched from the public gallery.
His job of Work and Pensions Secretary went to Damian Green, who served under Mrs May at the Home Office for four years as immigration minister and policing minister until his surprise sacking by Mr Cameron in 2014.
The daughter of a Church of England pastor, she is cricket fan with a sober demeanour who lists her hobbies as cooking and walking.
She is well-liked in and around Maidenhead, the well-to-do commuter town west of London she has represented in parliament since 1997. He announced Monday that he would leave office today, after it became clear that Theresa May would be the member of his Conservative party to succeed him.
Five women besides May already hold Cabinet posts - Justine Greening, Nicky Morgan, Amber Rudd, Liz Truss, and Teresa Villiers. She rewarded Johnson with the plum job of foreign secretary.
After a startlingly swift transfer of power that made her Britain's prime minister, Theresa May took charge of a new government on Wednesday, vowing to honor the referendum to leave the European Union and naming Boris Johnson, the former London mayor who had been widely considered politically dead, as foreign minister.