Mortgage financing giants Fannie Mae and Freddie Mac are seeing a marked improvement in home values, which is significantly boosting their bottom lines even as Washington considers abolishing them.

The news out of the two firms, which back the majority of U.S. mortgages, is the latest sign that the housing market may be turning a corner after years of being a drag on the economy.

After reporting a profit of $5.1 billion for the second quarter Wednesday — which came on top of paying a $2.9 billion dividend to taxpayers — Fannie Mae also appeared to make a case for its continued existence.

“With our high-quality new book of business and diminishing legacy expenses, Fannie Mae has strong potential earnings power that can deliver considerable value to taxpayers over the long term,” Timothy J. Mayopoulos, president and chief executive, said in a statement.

President Obama and congressional Republicans have agreed that the firms, with nearly 9,000 local employees combined, should be eliminated.

D.C.-based Fannie and McLean-based Freddie play critical roles in the nation’s housing market and the overall economy. The firms back more than half of all mortgages made by U.S. banks. They also guarantee mortgage-related investments that have been central to the Federal Reserve’s efforts to stimulate economic growth.

Obama has floated two possible directions for what would follow Fannie and Freddie’s elimination. In one scenario, the government would create smaller governmental or private entities that would support homeownership. In the second, the government would step back completely and rely on the private sector to fill Fannie and Freddie’s roles.

A senior Obama administration official said Wednesday that the administration stands by its prior views.

Congressional Republicans have favored proposals that simply shutter Fannie and Freddie. Lawmakers who have loudly criticized the mortgage giants did not respond to requests for comment Wednesday.

Fannie and Freddie, which were seized by the government in 2008, are a source of enormous controversy in Washington. The firms have cost taxpayers just shy of $150 billion, after taking into account dividend payments. Both companies noted in their earnings reports this week that they did not need taxpayer assistance for the second quarter.

Fannie has received about $117 billion in taxpayer bailouts, and has paid back nearly $26 billion.

The firm said its earnings in the second quarter were driven by higher home prices, better sales of foreclosed properties and fewer homeowners falling behind on monthly mortgage payments. Fannie’s second-quarter results came on top of a $2.7 billion profit in the first three months of the year.

“The magnitude of the home-price improvement that we saw was greater than we would have expected from normal seasonal upticks, so that’s encouraging,” said Susan McFarland, Fannie Mae’s chief financial officer, in a statement. “But I don’t think we’re going to see this level of earnings repeat itself quarter in and quarter out.”

Mayopoulos, in his statement, said, “It is too early to declare a national housing recovery” and that a weaker economy in the second half of the year may portend worse financial results.

Freddie reported similarly strong earnings Tuesday, when it announced a $3 billion profit in its most recent quarter, also largely due to an improved housing market. The company paid a $1.8 billion dividend to taxpayers.

The firm would not say whether it thinks the improved results bolster the case for its continued existence.

“That’s ultimately a question for policymakers to decide,” said Freddie Mac spokesman Michael Cosgrove. “Of course we are pleased with our second-quarter financial results and will continue — as we have been — to do everything we can to manage the company in the best interests of the U.S. taxpayer.”

Fannie and Freddie’s rebound — which is not expected to enable the firms to ever pay back taxpayers fully — nevertheless is another signal of the housing market’s nascent recovery.

Home prices rose by 1.3 percent in June, rising for the fourth consecutive month, according to data from CoreLogic released this week. Freddie Mac’s house price index also showed an uptick, rising 4.8 percent from March to June, the largest increase in eight years.

Of course, head winds remain. More than 30 percent of people with mortgages owe more than their properties are worth, according to a report from housing Web site Zillow. And millions of Americans still face foreclosure.