Shearer, who led Labour from 2011 until 2013, said his political life had not included time in Government or Cabinet "and I didn't get to be Prime Minister".
"The song goes, 'regrets, I've had a few.' But the goal was always to leave, maybe with some regrets, but without bitterness."
One of those regrets was the end of his time as Labour leader in 2013 without fighting an election.
"For me, the Labour leader was both a highlight and, obviously, ultimately a disappointment."
He said it was a privilege to have his photo on the wall of Labour leaders and did not want to analyse what had happened. He made only an oblique reference to his polling levels in the mid 30s when he resigned, saying "sadly, I think we were at our best at the end."
He revealed it was Damien O'Connor who had prompted him to stand for the leadership.
"He said, 'I'll vote for you.' so I threw in my name. In these contests, you understand, two votes are vastly superior than just the one."
He choked up when talking about his wife Anushcka "my rock." He also recalled his daughter once asking why people were mean to him. When he said it was because he was a politician, she said, "they should remember that you're a human being as well".
"It's tough for kids to see their parents attacked in the media and it's impossible to
hide it from them."
He thanked those who had supported him and said he wished the best for his party and for leader Andrew Little, whom he said had the right qualities for the job.
Shearer said he believed a capital gains was needed as well as changes to superannuation settings - policies held by Labour until they were dropped by Little.
Shearer also referred to his support for free trade - Shearer was a supporter of the Trans Pacific Partnership which the Little-led party opposed.
Shearer said his attachment to the Labour Party was "heartfelt and very simple."
"Over the past century, no other institution has shaped New Zealand and how we see ourselves as people. We take our boldness and achievements for granted."
He referred to Michael Joseph Savage's creation of the welfare state, Norm Kirk's decision to send a frigate to Mururoa and the architects of the Waitangi Tribunal - an institution he said should be exported to other countries.
"Those nation-shaping decisions and others relied on courageous people who stood up, despite what the polls or focus groups said, and they were big and visionary and they occurred under Labour.
"So if I could make one teeny weeny criticism of this [National] Government, with such immense political capital I think it could have been more ambitious."
He ended by wishing his fellow parliamentarians well.
"And whoever wins next year, and no prizes for guessing who I'll be backing, take care of my country for me and for God's sake be bold."
Well-liked, Shearer was given a standing ovation by both sides of the house.