David Cameron has been given a standing ovation by Conservative MPs after his final Prime Minister's Questions.
The prime minister, who will go to Buckingham Palace later to tender his resignation to the Queen, told MPs he would "miss the roar of the crowd".
Defending his achievements in office, he said there had been many "amazing moments" during his six years in power.
Home Secretary Theresa May is preparing to succeed Mr Cameron later after her own audience with the Queen.
After taking office, Mrs May will set about naming her own frontbench team.
Conservative MPs rose as one to applaud David Cameron at the end of his 182nd session as prime minister, with Labour MPs also joining in with the clapping, including Jeremy Corbyn.
Mr Cameron told then that he intended to stay in public life and would be "willing them on", saying "nothing is impossible". In his final remarks, he reprised a remark he made to Tony Blair during his first ever PMQs as opposition leader in 2005. saying: "I was the future once".
During a generally light-hearted and jocular session of Prime Minister's Questions, Mr Cameron said he had clocked up 5,500 questions at the despatch box, joking that he would leave it to others to decide how many he has answered.
He dismissed suggestions he will look to take over as the host of Top Gear or England manager, joking they "sound even harder" than being PM.
He also stressed his love for Larry the Downing Street cat – amid rumours that he was not a fan – and swapped warm wishes with Jeremy Corbyn, saying he had almost come to admire the Labour leader's "tenacity" in hanging on to his job.
Defending his economic, social and foreign affairs legacy, Mr Cameron said there had been "many amazing moments" over the past six years of "public service in the national interest".
Mr Cameron "warmly congratulated" Theresa May, who sat next to him during the session, on her election and told Labour leader Jeremy Corbyn that "when it came to female prime ministers I am glad to say the score will soon be two-nil".
Mr Corbyn said that although he had often disagreed with the PM, he thanked him for his service over the last six years and praised him for his backing for equal marriage and his efforts to secure the release of Shaker Aamer from Guantanamo Bay.
The Labour leader also paid tribute to Mr Cameron's wife Samantha and his family, who watched the proceedings from the public gallery. His daughters Nancy and Florence were seen to give their father a wave and cheer him on during the session.
Earlier, Mr Cameron told the Telegraph he came into Downing Street to "lead people through difficult decisions so together we could reach better times", adding "as I leave today, I hope people will see a stronger country, a thriving economy, and more chances to get on in life."
Later, after saying goodbye to staff at Downing Street, the PM will tender his resignation to the Queen,
The BBC's Royal Correspondent Nicholas Witchell said the private audience was likely to be a short one, potentially about twenty minutes.
Soon after, Mrs May will then make her own way to Buckingham Palace, accompanied by her husband Philip, when she will be asked to accept the monarch's offer to form a new government.
Our correspondent said Queen Elizabeth was likely to ask the new PM, who will be the 13th leader of her reign, about her "intentions and programme" for government.
Mrs May will then return to No 10 as the country's second female prime minister, following in the footsteps of Margaret Thatcher.
She is expected to briefly address the nation before meeting top officials, including Cabinet Secretary Sir Jeremy Heyward, and receiving a full national security and defence briefing.
She will be asked to hand-write letters to the commanders of the UK's four Trident submarines about what to do in the event of a catastrophic nuclear attack on the UK and to appoint two nuclear "deputies" – ministers who will take decisions on the deterrent if she has been rendered incapable.
She is also expected to take calls from a number of foreign leaders. Later on Wednesday, she will get down to the work of putting together her government – with key appointments set to be announced within hours.
The current home secretary, 59, was the only remaining candidate in the Conservative leadership contest following Andrea Leadsom's withdrawal on Monday.
The contest began when Mr Cameron, who has been prime minister since 2010, announced he would step down after losing the EU referendum in June.
Removal vans were spotted outside Downing Street on Tuesday, as Mr Cameron's ministers paid tribute to him in his final cabinet meeting.
Former Culture Secretary Maria Miller rejected suggestions that Mr Cameron's legacy would be totally defined by the decision to leave the EU, saying that while this seemed "a very big part of the political bubble" now, other achievements would endure.
She told Sky News the prime minister has "championed gay marriage and social justice while putting the Conservative Party in the centre ground" of politics and leaving behind a "strong economic foundation" to cope with the uncertainty caused by Brexit.
The swift transition of power comes after the expected nine-week leadership campaign was truncated to just a couple of days by leading Brexit campaigner Andrea Leadsom's surprise withdrawal.
Mrs May, who backed a vote to remain in the EU, will unveil her full ministerial team over the next couple of days, with the focus on the key positions of chancellor and foreign secretary as well who will be put in charge of leading the Brexit negotiations.
She is expected to promote a number of women to senior positions, with International Development Secretary Justine Greening and Energy Secretary Amber Rudd among those likely to get upward moves.
Asked her about her prospects, Ms Rudd told reporters: "I haven't been told anything yet so I'm just going to get on with my day job".