The U.S. Treasury Department said it generated a $25 billion profit on the sale of mortgage bonds purchased at the height of the financial meltdown.
The Treasury bought $225 billion of mortgage-backed securities during 2008 and 2009 as part of the government's response to the financial crisis and the collapsing housing market.
The profit from the sales, which began about a year ago, is the biggest for any program tied to the crisis.
"The successful sale for these securities marks another important milestone in the wind-down of the government's emergency financial crisis response efforts," said Mary Miller, the Treasury's assistant secretary for financial markets, in a statement. She added that the sales helped support the housing market "during a critical moment" for the economy.
The announcement also underlines the extent to which government support has driven the recovery of financial markets and the costs of that far-flung effort.
The Treasury's mortgage purchases were just one aspect of government support for banks, financial markets and the housing sector. The related federal takeover of Fannie Mae and Freddie Mac has cost $151 billion.
The mortgage-debt program was in force at a time when the Federal Reserve was supporting that market by buying and holding hundreds of billions of dollars of mortgage debt, and boosting all financial markets by keeping short-term interest rates near zero.
The Treasury also disbursed $414.3 billion under the Troubled Asset Relief Program, which aimed to restore investor confidence in U.S. financial firms. The program had collected $331 billion, about 80% of the total, from dividends, interest, disposals and other revenue, a Treasury official said. The Congressional Budget Office in December forecast a lifetime cost of $34 billion for TARP.