London (CNN) A British member of the House of Lords quit his government post after turning up late to answer questions, saying he was "thoroughly ashamed" of himself -- before later un-resigning after the prime minister rejected his exit as "unnecessary."

Lord Bates, a junior minister in the UK Department for International Development, stunned colleagues when he announced he missed a question from Baroness Lister of Burtersett in parliament's upper chamber Wednesday.

Treasury Minister Lord Bates just resigned from the government after apologising for missing a question from Labour's Baroness Lister of Burtersett. pic.twitter.com/3hLXmaDC2B — Richard Morris (@imrichardmorris) January 31, 2018

"I wonder if you permit me to offer my sincere apologies to Baroness Lister for my discourtesy in not being in my place to answer her question on a very important matter," Lord Bates said shortly after he arrived at his place.

"During the five years of which it's been my privilege to answer questions from the despatch box on behalf of the government, I've always believed we should offer -- rise -- to the highest possible standards of courtesy and respect in responding on behalf of the government to the legitimate questions of the legislature."

"I'm thoroughly ashamed at not being in my place and therefore I shall be offering my resignation to the Prime Minister with immediate effect. I do apologize."

Read More