Fannie Mae and Freddie Mac's government overseer warned Congress Thursday that the two bailed-out mortgage giants face the possibility of having to draw billions of dollars from the Treasury Department by next year, a risk that could roil markets if that borrowing is seen as another bailout.

Mel Watt, the director of the Federal Housing Finance Agency, told a panel of senators Thursday that the government-sponsored enterprises will see their capital buffer reduced to zero under law by the start of next year, leaving the companies at the mercy of markets. Any losses would force them to draw on their line of credit at the Treasury that was created when they were bailed out nearly a decade ago, creating the perception of a taxpayer bailout even if not the reality.

"We reasonably foresee that this could erode investor confidence" in the $5 trillion market of mortgage securities backed by the two companies, Watt warned the Senate Banking Committee. "This could stifle liquidity in the mortgage-backed securities market and could increase the cost of mortgage credit for borrowers."

Watt told the senators not to be surprised by any steps he might take to prevent that outcome, such as suspending dividend payments from Fannie and Freddie to the Treasury.

Fannie and Freddie have remained in the government's hands for nine years after being bailed out in the midst of the subprime crisis in 2008. Since then, Congress has failed to enact legislation to resolve their status, although recently the Trump administration and congressional Republicans have begun a renewed effort to do so.

In the meantime, the companies have been forced to reduce their capital to zero under the law, and the risk of them requiring a draw on Treasury funds has only increased.

Nevertheless, the threat would be that Congress would overreact to such a draw, on the perception that it constituted a bailout. With a $258 billion line of credit available at the Treasury, Fannie and Freddie are not likely to be at risk of actually requiring new rescue measures.

The reason the government-sponsored enterprises are at risk of requiring that bailout is because the Treasury has chosen to take all of their profits, rather than allowing them to retain profits and build capital to avoid drawing on the Treasury credit line.

Fannie and Freddie have paid $270.7 billion in dividends to the Treasury since receiving an initial bailout of $187.5 billion. Since 2012, they have been required to send all profits to the Treasury, rather than keep any to rebuild capital.

At Thursday's hearing, Sen. Bob Corker, R-Tenn., challenged the idea that drawing on the Treasury credit line would pose a risk to the companies' finances.

"Why don't you go ahead and draw $10 billion on it right now," he asked Watt. "I'm telling you, it's going to have no effect." Any private company with a $258 billion line of credit at the Treasury would face no risk from investors, he suggested.

"I can't afford to take that risk anymore than I could afford to drive a car that has a recall on it on an airbag with my family in it," Watt replied. Although the risk of a draw shaking investors was small, he said, it is his job to minimize it.

"It's one of the most baseless arguments I've ever heard," Corker said.

In his testimony, Watt argued that his agency has imposed many reforms on the agencies since they failed in 2008. It would be "unfounded" to say they are the same as they were when they collapsed, he said.

Nevertheless, he added, only Congress can change the housing finance system to resolve the bailed-out status of Fannie and Freddie.