Jeremy Hunt considered resigning as media secretary when the row over his handling of the BSkyB bid broke, he revealed today.
In a dramatic and long-awaited appearance at the Leveson inquiry, Mr Hunt was forced to listen as several embarrassing messages between himself, his special adviser Adam Smith, James Murdoch and Fred Michel, News Corp lobbyist, were read out in the court.
"There was a big storm going on," Mr Hunt told the inquiry, referring to the day after James Murdoch gave evidence and revealed the full extent of the communication between Mr Smith and Mr Michel.
"We knew some language was inappropriate so we came to the conclusion, with very heavy hearts, that we would have to support his decision to resign."
Inquiry counsel Robert Jay asked: "Did you say 'everyone here thinks you need to go'?"
Mr Hunt replied: "Yes."
He added: "I did think about my own position but I had conducted the bid scrupulously fairly. I decided it wouldn't be appropriate for me to go but, with a heavy heart, we didn't have any choice but to accept Adam's resignation."
The inquiry failed to find a smoking gun which would see Mr Hunt ejected from his job, but the various emails, texts and phone calls proved highly embarrassing to the media secretary, who cut a hesitant and nervous figure for the duration of the session.
Moments after the session ended, however, David Cameron confirmed he would not refer Mr Hunt to the independent adviser on ministerial interest or the Cabinet secretary.
A Downing Street spokesperson said: "Jeremy Hunt’s evidence has shown that he acted properly while he was responsible for the BSkyB bid. He took independent advice at every turn, as well as a number of decisions which were against News Corp's wishes."
Shadow media secretary Harriet Harman said: "Jeremy Hunt should not be in his job now as he has broken the ministerial code and misled parliament. At the very least, David Cameron should refer him to the independent adviser on ministerial interests.
"David Cameron said he would stand up for high standards but he is sweeping this matter under the carpet."
Even if the media secretary has survived the testimony without losing his job, his reputation was severely damaged by the evidence session.
It was revealed today that just before he was handed responsibility for the bid, Mr Hunt texted James Murdoch with the message: "Congrats on Brussels, just Ofcom to go!"
On the day Vince Cable had his responsibility for the bid taken away from him, Mr Murdoch phoned Mr Hunt. Immediately after that call, Mr Hunt texted George Osborne and emailed Andy Coulson.
"Could we chat about Murdoch Sky bid? Am seriously worried we are going to screw this up," he texted Mr Osborne.
The chancellor replied: "I hope you like our solution."
A few hours later Mr Hunt was handed responsibility for the bid, despite the prime minister knowing he was an enthusiastic supporter.
The media secretary insisted that once the quasi-judicial process began he "set aside any views" he had.
"My suitability for the role is demonstrated by the actions I took once I had it. I set up a process to make sure I couldn't use those sympathies."
Mr Hunt brought Ofcom, the Office of Fair Trading (OFT) and a legal team on board to take away his "wriggle room", he said.
However, he also admitted he was unclear on what acting quasi-judicially actually involved and failed to tell Mr Smith what he could not do.
"I wish he'd told us about the pressure he was under and the barrage he was facing," Mr Hunt said of his special adviser.
"The consequences were very unfortunate.
"The barrage he was subjected to, the amount of contact ended up pushing him into language that was inappropriate and we need to think hard about preventing that happening again in the future."
The Leveson inquiry continues on Monday.