Mortgage-finance company Fannie Mae will send the U.S. Treasury Department $4.4 billion in September, as an interest-rate increase helped drive a 27% rise in its second-quarter profits.

The company said its second-quarter net income grew to $4.64 billion from $3.67 billion in the same quarter of 2014. Helping profit was a $2.61 billion fair-value gain, while the prior-year period included a $934 million fair-value loss.

Fannie said the increased interest rate boosted the value of its risk-management derivatives.

Fannie and peer Freddie Mac were put into a so-called conservatorship under government control during the 2008 financial crisis, eventually receiving nearly $188 billion in support from the U.S. Treasury. In the past few years, the companies have been immensely profitable, sending the government more than they took.

Under the current terms of its bailout, the companies must send nearly all of their profits to the government in the form of dividends and wind down their capital buffers over time.

After the September payment, Fannie will have sent $142.5 billion to taxpayers.

Fannie Mae doesn't make loans. Instead, it purchases them from lenders, wraps them into securities and provides investors guarantees to make them whole if the loans default.

In the latest quarter, net interest income, which includes fees from backing mortgages, was $5.68 billion, up from $4.9 billion a year earlier. Guaranty fee revenue again drove growth.

In recent years, a larger portion of Fannie's net interest income has been made up of guaranty fees, rather than interest income earned on its retained mortgage portfolio assets. Fannie said the shift reflects guaranty fee increases implemented in 2012 and shrinking of its retained mortgage portfolio.

Fee and other income grew to $556 million from $383 million in the prior-year period. Credit-related expense was $1.2 billion in the quarter, hurt by mortgage interest rate increases, compared with income of $1.85 billion a year earlier.

Earlier this week, Freddie also reported a sharp gain in second-quarter profit because of an increase in the value of derivatives that it uses to hedge its interest-rate risk.

The derivatives gains and losses reflect an accounting mismatch between how the derivatives and the assets that the derivatives hedge are valued, and Freddie expects the net effect to be neutral over time.

Write to Chelsey Dulaney at Chelsey.Dulaney@wsj.com

Subscribe to WSJ: http://online.wsj.com?mod=djnwires