With his wife Samantha and children Nancy, Elwen and Florence by his side, Mr Cameron claimed he was leaving the country much stronger than it was when he arrived at Number 10 six years ago and added that the economy was “immeasurably stronger”.
He sought to define his legacy at the end of a turbulent few weeks that will see him go down in history as the prime minister who lost the European Union referendum.
The Cameron family gathered outside Downing Street as Mr Cameron addressed the press and listed the things he was most proud of during his tenure as prime minister.
They included reducing the deficit, legalising gay marriage, boosting employment, introducing the National Living Wage, increasing international aid spending and cutting waiting times for NHS treatment.
There was a heartfelt message for his wife, who he described as “the love of my life” and the person who had “kept me vaguely sane”.
He said he was “delighted that for the second time in British history the new Prime Minister will be a woman, and once again a Conservative”.
Theresa May, he said, would provide “strong and stable leadership in delivering the Conservative manifesto on which we were elected” and wished her well in negotiating “the best possible terms” for Britain’s exit from the EU.
Mr Cameron concluded: “It has been the greatest honour of my life to serve our country as prime minister over these last six years and to serve as leader of my party over 11 years. And as we leave for the last time, my only wish is continued success for this great country that I love so very much.”
In scenes that were reminiscent of Gordon Brown and his family’s departure from Downing Street six years ago, Mr Cameron and his family left in two cars for Buckingham Palace.
Once there the family were greeted by the Queen’s equerry, Wing Commander Sam Fletcher. The outgoing prime minister’s last audience with the Queen lasted 30 minutes and saw him tender his resignation.
At some point Mr Cameron’s family was introduced to the Queen.
A few moments after he departed, Buckingham Palace issued a statement to confirm Mr Cameron had resigned.
It said: “The Right Honourable 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.’’
Earlier, Conservatives paid tribute to Mr Cameron during a jocular Prime Minister’s Questions session in the House of Commons.