The U.S. economy is struggling against headwinds that mean the government must retain the ability to respond to unexpected crises, even as it starts to wind down emergency programs, Treasury Secretary Timothy Geithner said on Thursday.

Testifying before a congressional panel that oversees the Troubled Asset Relief Program, or TARP, Geithner took credit for having averted a complete financial meltdown but warned against becoming too optimistic about a rebound.

The financial and economic recovery still faces significant headwinds, he said, citing high unemployment and home foreclosure rates, tight credit and impaired securitization markets, especially for mortgage-backed securities.

Geithner laid out a strategy for winding down the bank bailout program but also defended his decision on Wednesday to extend it past a scheduled year-end expiry, until next October 3, as a necessary guard against a sudden economic relapse.

History suggests that exiting too soon from policies designed to contain a financial crisis can significantly prolong an economic downturn, he said.

TARP was approved by Congress last year as a $700-billion program to buy toxic or impaired assets from banks but was immediately converted into a fund for Treasury to make capital injections into ailing banks.

Big banks now are eager to exit TARP by repaying their bailout money, partly to free themselves from pay restrictions.

Bank of America sent Treasury a $45-billion check on Wednesday to do so. Citicorp also is talking to Treasury about doing so.

Geithner said it was a good thing for the country that banks are eager to get out of TARP but it has to be done with care. We are not prepared to have this money come back in a way that would leave the system or these institutions without adequate capital to face their challenges ahead.

Citigroup got $45 billion of TARP money last year.

Geithner said the TARP investments made in banks were returning more money sooner than thought and the next few weeks will bring substantial income from more sales of warrants to buy stock in banks that are repaying bailout money.

Geithner said he was extending TARP, on a modified basis, through next October because he didn't want a repeat of the situation in which the government potentially faces a crisis without having adequate tools on hand to deal with it.

It is imperative that we maintain this capacity to respond if financial conditions worsen and threaten our economy, Geithner said, adding that before he would commit more funds I would consult with the president and Chairman of the Federal Reserve Board and submit written notification to Congress.

The Congressional Oversight Panel on Wednesday released its assessment of the TARP program, conceding that while it had helped stabilize the financial system it had not succeeded in boosting lending.

In addition, it failed to resolve the issue of too-big-to-fail financial institutions and in fact created an implicit guarantee that the government would again bail them out if they got into serious trouble.

Geithner said not all TARP investments will be returned.

There is a significant likelihood that we will not be repaid for the full value of our investments in AIG, GM and Chrysler, he said, though some $15 billion more likely will come back than was originally projected

In response to questions, Geithner said Treasury was pressuring banks to do more to ease the harm from rising home foreclosures, especially by pushing them to make more permanent modifications in mortgage loans.

We are using a tremendous amount of force and persuasion to try to make sure we get those conversion rates up to a reasonable level, he said. They need to do a better job and they have the ability to do that.

(Reporting by Glenn Somerville; Editing by Andrew Hay)