WASHINGTON  The federal bailout of Fannie Mae and Freddie Mac may be winding down with relatively little additional cost to taxpayers so long as the economy continues to recover. But if the economy tips back into recession, the bailout could nearly double in size, according to new government projections announced on Thursday.

The troubled mortgage companies are likely to require about $19 billion in additional federal aid over the next three years, according to a projection by the Federal Housing Finance Agency.

If the economy recovers more quickly than expected, the projections show that the companies could need as little as $6 billion in new aid. By contrast, if the economy falls into recession, the companies could need another $124 billion.

The Treasury Department has spent $135 billion on Fannie and Freddie since they were seized by the government in 2008, to cover their losses on soured mortgage loans. The government is propping up the two companies to make sure that money remains available for mortgage loans. Even under the worst case detailed on Thursday by the housing finance agency, the pace of new cash infusions would decline sharply.