Washington CNN  — 

Retired Gen. David Petraeus, the former top military commander and ex-CIA Director, apologized Tuesday before a Senate committee for an extra marital affair as he returned for his first public hearing since he resigned from his post in 2012.

“I think it is appropriate to begin my remarks this morning with an apology … one that I have offered before, but nonetheless one that I want to repeat to you and to the American people,” Petraeus said Tuesday before the Senate Armed Services Committee.

“Four years ago, I made a serious mistake,” he said. “There is nothing I can to do to undo what I did. I can only say again how sorry I am to those I let down, and then strive to go forward with a greater sense of humility and purpose, and with gratitude to those who stood with me during a very difficult chapter in my life.”

Petraeus is on Capitol Hill to give his advice to the Senate committee on the U.S.’s Middle East policy, nearly three years after he tendered his resignation as CIA Director after admitting to having an extramarital affair with his biographer, Paula Broadwell.

The affair prompted a federal investigation that led to Petraeus pleading guilty to mishandling classified materials. He admitted to giving highly sensitive information to Broadwell. He was sentenced to two years probation and ordered to pay a $100,000 fine.

Petraeus on Tuesday called the “serious mistake” he made one that “brought discredit on me and pain to those closest to me.” He called the error a breach of trust and of “the values to which I had been committed through my life.”

Before his role at the CIA, Petraeus was a top military commander in charge of troops in Iraq and Afghanistan, leading the successful surge campaign in Iraq in 2007 under President George W. Bush and the subsequent troop surge in Afghanistan under President Barack Obama.

Despite pleading guilty to mishandling classified materials, Petraeus remains widely regarded voice on U.S. military strategy and is still a top White House policy adviser on Iraq.

RELATED: Convicted leaker Petraeus still advising White House