Government-backed mortgage giants Fannie Mae and Freddie Mac are paying a combined $10 billion in dividends to the U.S. Treasury, a sign that a revived housing market is allowing the once-ailing firms to subsidize federal government spending.

Fannie Mae FNMA, -2.45% on Friday reported a $5 billion fourth-quarter profit, and said it will pay a $5.5 billion dividend to the Treasury.

On Thursday, Freddie Mac FMCC, -2.06% reported a $4.8 billion profit during the fourth quarter and said it will pay a $4.5 billion dividend.

The two companies went under government conservatorship during the financial crisis and, thanks to a hotly-disputed Treasury ruling, “sweep” their profits to the government. New Treasury Sec. Steven Mnuchin said at his confirmation hearing that Fannie and Freddie shouldn’t be left under government control “without a fix” but also said he didn’t want to limit housing finance.

Hopes for privatization has lifted the over-the-counter shares of Fannie, up 6.7% this year, and Freddie, up 7%. But even with Republican control of both chambers of Congress, experts say pushing through legislation to privatize Fannie and Freddie will be difficult, mostly on concerns over how such a move would impact the housing market but also because of the hit to federal coffers.

The Federal Housing Finance Agency, which regulates Fannie and Freddie, has pushed so-called guarantee fees higher in a bid to draw more private companies into the housing system.

That move hasn’t done much so far — private-label securities represented just 1% of the market for new single-family mortgage-related issuance in 2016.

The two giants have a vastly stronger book of business than they did during the crisis. Fannie’s single-family serious delinquency rate has dropped for 27 straight quarters and was at1.2% at the end of the year. Freddie’s delinquency rate was 1%.

Though fourth-quarter data isn’t yet available, the single-family delinquency rate for the nation as a whole was 2.96% in the third quarter, according to the Mortgage Bankers Association.