The U.S. Treasury Department said on Monday it has completed the sale of a $225 billion portfolio of mortgage-backed securities it bought in 2008 and 2009 amid the financial crisis and made a $25 billion profit.

"The successful sale of these securities marks another important milestone in the wind down of the government's emergency financial crisis response efforts," the Treasury's assistant secretary for financial markets, Mary Miller, said in a statement.

The Treasury began selling the securities, which it had bought when the markets were under severe stress, last year and said it took in $250 billion in total for them in sales, principal and interest.

Treasury bought the mortgage-backed securities under the authority given it by the Housing and Recovery Act of 2008. A Treasury official said the government still has a loss of $151 billion on investments made in Fannie Mae and Freddie Mac but said the Office of Management and Budget projects that loss will fall to $28 billion by 2022.