(Adds detail on Maiden Lane facilities )
NEW YORK, July 29 (Reuters) - The U.S. Federal Reserve's balance sheet decreased in the latest week, Fed data released on Thursday showed.
The balance sheet -- a broad gauge of Fed lending to the financial system -- was $2.308 trillion on July 28 versus $2.315 trillion on July 21.
Fed lending remains near its record high of $2.334 trillion hit in May. After declining early last year, the balance sheet started accumulating mass amid the U.S. central bank's asset-buying program.
The program, known as quantitative easing, was aimed at broadly holding down borrowing costs and supporting the ailing housing market as the economy recovered from the worst recession in 70 years.
That effort was also led by the Fed's purchases of mortgage-related securities, which came to a conclusion at the end of March. Since then, weekly balance sheet fluctuations have at times been influenced by the delivery of those securities, some of have lagged.
The Fed's holdings of mortgage-backed securities backed by housing finance companies Fannie Mae (FNMA.OB) and Freddie Mac (FMCC.OB) totaled $1.117 trillion on July 28 versus $1.125 trillion on July 21.
The U.S. central bank's ownership of debt issued by Fannie Mae, Freddie Mac and the Federal Home Loan Bank System was $159.38 billion, unchanged versus the previous week.
Primary credit via the Fed's discount window averaged $11 million per day in the latest week, down from $25 million per day in the previous week.
This report also marked the first time all three Maiden Lane LLC facilities were in the black, with fair value readings above par.
The entities were created to house assets related to the firesale of Bear Stearns to JPMorgan and the bailout of AIG.
This development increases the likelihood that the New York Fed won't lose money on its holdings of these assets. (Reporting by Burton Frierson; Editing by Dan Grebler)