Goldman also won federal debt guarantees and received $10 billion under the Troubled Asset Relief Program. It benefited further when the Securities and Exchange Commission suddenly changed its rules governing stock trading, barring investors from being able to bet against Goldman’s shares by selling them short.

Now that the company’s crisis has passed, Goldman has rebounded more markedly than its rivals. It has paid back the $10 billion in government assistance, with interest, and exited the federal debt guarantee program. It recently reported second-quarter profit of $3.44 billion, putting its employees on track to earn record bonuses this year: about $700,000 each, on average.

Ms. Davis, the spokeswoman for Mr. Paulson, said Goldman never received special treatment from the Treasury. Mr. Paulson’s calendars do not disclose any details about his conversations with Mr. Blankfein, and Ms. Davis said Mr. Paulson always maintained a proper regulatory distance from his old firm.

A spokesman for Goldman, Lucas van Praag, said: “Lloyd Blankfein, like the C.E.O.’s of other major financial institutions, received calls from, and made calls to, Treasury to provide a market perspective on conditions and events as they were unfolding. Given what was happening in the world, it would have been shocking if such conversations hadn’t taken place.”

Although federal officials were concerned that Goldman Sachs might collapse that week, Mr. van Praag said the only topics of discussion between Mr. Blankfein and Mr. Paulson at the time involved Lehman Brothers’ troubled London operations and “disarray in the money markets.” Mr. van Praag said Goldman was fully insulated from financial fallout related to a possible A.I.G. collapse in mid-September of last year.

However, Mr. Paulson believed he needed to request the ethics waivers during that tumultuous week, after regulators had become concerned that the same crisis of confidence that felled Bear Stearns and Lehman might spread to the remaining investment banks, including Goldman Sachs.

At a conference call scheduled for 3 p.m. on Sept. 17, 2008, Fed officials intended to discuss the financial soundness of Goldman Sachs, Merrill Lynch and Morgan Stanley, and they had asked Mr. Paulson to participate, according to Mr. Paulson’s calendars and his spokeswoman.

That was the first time during the crisis that Mr. Paulson’s involvement required a waiver, Ms. Davis said. The waiver was requested that morning and granted orally that afternoon, just before the 3 p.m. conference call.

A few minutes later, in an e-mail message to Mr. Paulson, Bernard J. Knight Jr., assistant general counsel at the Treasury, outlined the agency’s rationale for granting the waiver.

“I have determined that the magnitude of the government’s interest in your participation in matters that might affect or involve Goldman Sachs clearly outweighs the concern that your participation may cause a reasonable person to question the integrity of the government’s programs and operations,” Mr. Knight wrote.

Goldman’s Windfall

For investors in the United States and around the world, the days after the A.I.G. rescue were perilous and uncertain; the Dow Jones industrial average fell 4 percent on Sept. 17 as credit markets froze and investors absorbed the implications of the insurance giant’s collapse. That day, Mr. Paulson and his colleagues at the Federal Reserve were scrambling to contain the damage and shore up investor confidence.

But Mr. Paulson has disavowed any involvement in the decision to use taxpayer funds to make Goldman and A.I.G.’s trading partners whole. In his July testimony to the House, he said: “I want you to know that I had no role whatsoever in any of the Fed’s decision regarding payments to any of A.I.G.’s creditors or counterparties.”

Ms. Davis reiterated this, saying that Mr. Paulson’s involvement in the A.I.G. bailout was meant to forestall a collapse of the entire financial system and not to rescue any individual firms exposed to A.I.G., like Goldman. However, she said, federal officials were worried that both Goldman and Morgan Stanley were in danger themselves of failing later in the week and it was in that context that Mr. Paulson received a waiver.

“The waiver was in anticipation of a need to rescue Goldman Sachs,” Ms. Davis said, “not to bail out A.I.G.”

Treasury Department lawyers said a waiver for Mr. Paulson regarding A.I.G. was not necessary, Ms. Davis said, because the A.I.G. rescue was conducted by the Federal Reserve. The Treasury had no power to rescue A.I.G., she said. Only the Fed could make such a loan.

But according to two senior government officials involved in the discussions about an A.I.G. bailout and several other people who attended those meetings and requested anonymity because of confidentiality agreements, the government’s decision to rescue A.I.G was made collectively by Mr. Paulson, officials from the Federal Reserve and other financial regulators in meetings at the New York Fed over the weekend of Sept. 13-14, 2008.