The mortgage giants Fannie Mae and Freddie Mac reported Thursday that their second-quarter profits will enable them to send $5.6 billion to the U.S. Treasury, even though the profits were markedly lower than they were the previous quarter.

D.C.-based Fannie reported income of $3.7 billion in the quarter that ended June 30, down from $5.3 billion the previous quarter and $10 billion a year earlier.

McLean-based Freddie, its smaller rival, said profits fell to $1.4 billion from $4 billion in the first quarter and $5 billion a year ago.

Both companies said the declines largely reflect less income from legal settlements involving shoddy mortgages they purchased before the housing crisis hit. Fannie and Freddie have warned that the record profits they posted in the past several quarters were mostly due to onetime gains and would not be sustainable at such high levels.

“This quarter gives you a good sense of a normalized environment for Fannie Mae,” Tim Mayopoulos, Fannie’s chief executive, said during a call with reporters Thursday. Fannie expects to remain profitable for the foreseeable future, Mayopoulos added.

The government seized control of both companies in September 2008 to keep them solvent as the housing market unraveled. The firms’ losses were piling up at the time. The government started pumping cash into the institutions, fearing that Fannie and Freddie would otherwise collapse and send global financial markets into a tailspin.

The companies buy mortgages from lenders, then package them into securities and sell them to investors. For a fee, they insure the loans and pay investors should a loan go bad. Together they back about 60 percent of all U.S. home loans.

The government’s bailout of Fannie and Freddie has cost taxpayers $188 billion. Now that the companies have turned huge profits for several quarters in a row, they will have sent nearly $219 billion to the U.S. Treasury by September. However, because of the way the bailout is structured, the companies can never “repay” the taxpayers.

Fannie said it expects to send $3.7 billion to the U.S. Treasury next month. That would bring its total payments to $130.5 billion — exceeding the $116.1 billion it drew from the government’s coffers.

Freddie said it expects to send $1.9 billion to the government next month. With that, it will have sent $88.2 billion to taxpayers, or about $16.8 billion more than it drew from the Treasury.

The government changed the terms of the bailout in August 2012 and demanded that Fannie and Freddie send nearly all their profits to the Treasury in the form of dividends. Several investor groups — including the mutual fund Fairholme Capital Management and the hedge fund Perry Capital — have challenged that arrangement in court.

To avoid a repeat of the bailout, the Obama administration is pushing to dismantle Fannie and Freddie and shift the risks of mortgage lending away from taxpayers to the private sector. But a Senate bill that aimed to do just that is unlikely to reach the Senate floor this year.

During the earnings calls, both companies said that home price appreciation has helped boost their income, but they noted that home prices are moderating.

Mayopoulos also said that Fannie has seen some lenders ease up on the “credit overlays” they’ve imposed. These overlays include credit score requirements that are higher than what Fannie demands. In the wake of the housing bust, lenders have tightened their requirements above and beyond the levels set by Fannie and Freddie.

Mayopoulos also said that the number of “underwater” loans backed by Fannie have declined 40 percent since last year. Borrowers with such loans owe more on their mortgages than their homes are worth and are therefore vulnerable to foreclosure because they can’t sell or refinance in times of trouble.