Under tough questioning, former Treasury Secretary Timothy Geithner rejected the idea that the government was too harsh in 2008 when it bailed out insurance giant American International Group. Geithner, who was president of the New York Federal Reserve at the time, said in court Wednesday that AIG deserved strict treatment for engaging in risky behaviors.

Geithner took the stand as part of the trial meant to determine whether the government cheated AIG shareholders by allegedly taking equity amid an $85 billion loan. He is one of a parade of former regulators called to testify, with ex-Treasury Secretary Henry Paulson testifying Monday and former Federal Reserve Chairman Ben Bernanke scheduled to take the stand later this week.

Former AIG chief executive Maurice Greenberg is suing the government for $40 billion over the claim that a 14 percent interest rate and an 80 percent equity stake in AIG were unlawful demands. It was Geithner who said the government had the legal framework in place to bail out AIG after the insurance group failed to find private investors who could help the company avoid bankruptcy.

“The world was so fragile and the consequences of AIG’s failure were so great, that I was very confident that we met that test,” Geithner said Wednesday, as quoted by the New York Times.

AIG was held up as an example of Wall Street corruption when, after being granted an $85 billion loan package, the company paid out millions of dollars in bonuses to executives.

Emails from then-Fed Chairman Bernanke were introduced into court evidence Wednesday, highlighting the government’s philosophy that the restrictions on AIG should serve as a warning to other insurance firms that were acting like, as Bernanke put it, irresponsible hedge fund managers.

“We think they are days away from failure,” Bernanke wrote in one email, according to the Wall Street Journal. “They think it is a temporary problem. The disconnect is dangerous.”

When attorneys asked Geithner why he responded to such dire emails in the early morning hours when the rest of the world was asleep, he said Wall Street’s irresponsibility essentially left him no choice.

“The world was falling apart,” Geithner said. “We were trying to figure out whether to do anything about it … The world was burning around them.”