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.

A Republican critic of TARP, Texas Rep. Jeb Hensarling who wanted it to expire on December 31, resigned from the five-member oversight panel. He has called the bailout effort a failure because lending remains constrained.

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 repaying.

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.

Another monitor, the Special Inspector General's group or SIGTARP, issued a report on Thursday saying Treasury could do a better job of finding out how companies use bailout funds simply by asking them to detail where the money goes.

In some cases, companies leveraged TARP funds to provide loans or insurance policies worth significantly more than the face value of the TARP investment, SIGTARP's report said, adding that it has advocated consistently that Treasury make companies say how they are using the money.

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 the 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.

(Reporting by Glenn Somerville; Editing by Andrew Hay)