Judge Thomas Wheeler of the U.S. Court of Federal Claims rejected the government's effort to keep Bernanke from being deposed, saying the Fed chairman was a "central figure" in the decision to bail out AIG.
"Indeed, the court cannot fathom having to decide this multi-billion dollar claim without the testimony of such a key government decision maker," Wheeler wrote. "These facts constitute 'extraordinary circumstances' for the taking of Mr. Bernanke's deposition."
The Justice Department declined to comment on the ruling. A Fed spokesman declined to comment.
(Watch: Who will succeed Bernanke? )
Greenberg's Starr International Co, which once had a 12 percent stake in AIG, is suing over the government's taking of a 79.9 percent stake in the insurer in September 2008 and a separate 1-for-20 reverse stock split in June 2009.
Greenberg's attorney, Alanna Rutherford of Boies, Schiller & Flexner, said his team was pleased with the judge's decision.
Earlier this year Greenberg tried to force AIG to join his suit against the government over the $182.3 billion bailout, an effort the company ultimately rejected.
Greenberg is seeking tens of billions of dollars in compensation over the losses he incurred when the government rescued the company.
"Because of Mr. Bernanke's personal involvement in the decision-making process to bail out AIG, it is improbable that Plaintiff would be able to obtain the same testimony or evidence from other persons or sources," Wheeler wrote in his four-page order.
Wheeler said the court would extend "appropriate deference and courtesies" to Bernanke in scheduling the testimony; the judge also said he would attend the deposition himself.
It is tentatively scheduled for Aug. 16, the order noted.
The government had argued that details about Bernanke's role could be obtained elsewhere, such as meeting minutes from the Fed's Board of Governors, and that high-ranking U.S. officials in general should not be deposed over their official actions. It also said a deposition would distract Bernanke from overseeing the nation's economy and fiscal policy.
Wheeler, however, said it is "relatively routine" for top government officials to testify in Court of Federal Claims cases when they have personal knowledge of relevant information.
The court sits in Washington, D.C., and handles lawsuits seeking money from the government.
According to Wheeler, officials who have testified have included Dick Cheney, then secretary of defense; Andrew Cuomo, then secretary of housing and urban development; and General Colin Powell, then chairman of the Joint Chiefs of Staff.