The former Lloyds chairman made an urgent call to the Prime Minister at the height of the financial crisis to save the bank's deal to buy HBOS.
Sir Victor Blank said he called Gordon Brown to warn that the banking sector was at risk if the deal failed.
Some 5,500 Lloyds shareholders are suing the bank, Sir Victor and four other former directors, saying they should not have recommended the deal.
But Sir Victor told the High Court the deal was in shareholders' interest.
Lloyds and the directors are defending the claim and deny the allegations.
The former Lloyds chairman phoned Gordon Brown on 27 September 2008 because he feared both Lloyds and Barclays would be unable to borrow on money markets if the deal to HBOS failed and the bank was nationalised.
"I mean, I tell you I remember well – I walked around the garden three times, thinking what the heck can I do… just to pick up the phone and see if I could get hold of the Prime Minister and tell him it looked like a catastrophe was coming," Sir Victor said.
According to Sir Victor, the Prime Minister then intervened by calling the Bank of England, which extended support to HBOS that allowed the deal to go ahead.
Shareholders of Lloyds are suing Sir Victor and other former directors, claiming they should not have recommended the takeover of HBOS in the 2008 crisis without disclosing its true financial state.
Sir Victor was warned on Saturday 27 September 2008 by Lloyds chief executive Eric Daniels that HBOS was in danger of having to close its doors the following Monday.
"It was having difficulty in accessing the central banks schemes at that time, and that seemed to be the logjam," Sir Victor said.
Ten days earlier on 17 September the former Lloyds chairman had been warned by Bank of England governor Sir Mervyn King that HBOS would have to be nationalised if Lloyds did not announce a takeover the following day.
The takeover announcement was made on 18 September 2008. Lloyds shareholders claim the board recommended the takeover without disclosing how weak HBOS was.
In the following week, Lloyds' advisers discussed a joint funding plan with the Bank of England which was not disclosed to shareholders of either Lloyds or HBOS.
The former chairman of Lloyds Bank admitted he knew Lloyds had agreed to provide a loan to HBOS – but not when.
"I knew that Lloyds and HBOS were discussing a line (of credit) for HBOS but I couldn't tell you what date.
Richard Hill QC, for the claimants, accused Sir Victor of failing to disclose the loan: "You must have been aware of the facility and you must have been aware that it wasn't disclosed?"
Sir Victor replied: "You keep telling me I must have been aware and I keep telling you that I don't recall the circumstances as you are saying."
Mr Hill said: "It's obvious shareholders would want to know if they're being asked to buy a bank which is being kept from collapse by secret lending. What it meant was shares were being artificially kept up."
To which Sir Victor replied: "I don't agree. The market knew HBOS had had funding difficulties. The fact that there was a little bit more – I don't think that was material."
The case continues.