* Fed expects to trim bond buys but not on preset course
* Bernanke says eventual rate hike cycle to be gradual
* Fed chief says Fed could ramp up bond purchases if needed
* Remarks lift U.S. stocks and bonds, dollar firms
WASHINGTON, July 17 (Reuters) - Federal Reserve Chairman Ben Bernanke said on Wednesday the U.S. central bank still expects to start scaling back its massive bond purchase program later this year, but he left open the option of changing that plan if the economic outlook shifted.
While sticking closely to a timeline to wind down the bond buying that he first outlined last month, Bernanke went out of his way to stress that nothing was set in stone.
"Our asset purchases depend on economic and financial developments, but they are by no means on a preset course," he told the House of Representatives Financial Services Committee.
Under the plan Bernanke laid out on June 19, the U.S. central bank would likely reduce its monthly bond buys later this year and halt them altogether by mid-2014, as long as the economic recovery unfolds as expected.
He did not depart from that guidance on Wednesday, but he said the current $85 billion monthly pace of purchases could be reduced "somewhat more quickly" if economic conditions improved faster than expected. On the other hand, it "could be maintained for longer" if the labor market outlook darkened, or inflation did not appear to be rising toward the Fed's 2 percent goal.
"Indeed, if needed, the (Fed's policy) committee would be prepared to employ all its tools, including an increase (in) the pace of purchases for a time, to promote a return to maximum employment in a context of price stability," Bernanke said.
The remarks lifted U.S. stock prices modestly and government debt prices also rose. The dollar firmed against the euro and the yen.
"There is something in these comments for everybody," said Omer Esiner, chief market analyst at Commonwealth Foreign Exchange in Washington. "Bernanke has done a good job of leaving himself plenty of maneuver room in terms of policy."
Bernanke's testimony to Congress on the Fed's semi-anual monetary policy report may be his last if he steps down when his term as chairman ends in January, as many expect, and a number of lawmakers lauded him for his service.
Under Bernanke, the Fed has held overnight interest rates near zero since December 2008 and more than tripled its balance sheet to about $3.46 trillion with bond purchases aimed at driving down longer-term borrowing costs and spurring investment and hiring.
CALMING THE WATERS
Bernanke set off a brief but fierce global market sell-off last month when he outlined the Fed's plans to curtail its so-called quantitative easing, and he has joined a slew of officials since then who have spelled out their intention to keep rates near zero well after the bond buying ends.
Bernanke acknowledged that one of his motives in talking about tapering last month had been to head off a possible bubble in financial markets. Many economists had suspected that had been an important reason.
"Not speaking about these issues would have risked a dislocation, a moving of market expectations away from the expectations of the (Fed's policy) committee. It would have risked increased build-up of leverage or excessively risky positions in the market," he said.
While the end of the Fed's bond buying may be in view, Bernanke repeated that officials will keep rates near zero at least until the jobless rate, which stood at 7.6 percent in June, falls to 6.5 percent, as long as inflation remains in check.
He also said the Fed would look closely at any decline in unemployment to see whether it was being driven by strength in hiring or a decline in the number of Americans looking for work, in which case the central bank would be more patient before raising rates.
Any rate hike cycle, he said, would be gradual.
"We intend to be very responsive to incoming data, both in terms of our asset purchases - but it's also important to understand that our overall policy, including our rate policy, is going to remain highly accommodative," Bernanke said.
The testimony led traders in futures markets to push back their expectations for when rates will rise to December 2014 from as early October 2014 a day earlier. The Fed said last month that 14 of its 19 policymakers do not believe it would be appropriate to raise rates until sometime in 2015.
As for bond purchases, economists on Wall Street expect the Fed to start reducing them at its meeting in September.
Speaking about the Fed's bloated balance sheet, Bernanke suggested the central bank would hold the government bonds it has bought for a long time, if not to maturity, and reinvest any proceeds to keep its balance sheet from shrinking quickly.
RECOVERING AT A MODEST PACE
Some Fed officials have been concerned about the low level of inflation and have expressed a hesitance to trim bond purchases until inflation quickens. The central bank's preferred price gauge is a full percentage point below its target.
Bernanke repeated his view that transitory factors appeared to be restraining price gains, although he said policymakers were aware that very low inflation raised the risk of an outright deflation, which could sap the economy's strength.
Data on Tuesday showed that inflation firmed last month, and hiring in recent months has been relatively strong.
However, the government said on Wednesday groundbreaking for homes fell to a 10-month low. In addition, retail sales were weak in June, and second-quarter GDP growth is expected to come in at around a dismal 1 percent annual rate, painting a very mixed picture for Fed policymakers.
Bernanke, who appears for a second day of testimony before the Senate Banking Committee on Thursday, said the economic recovery was continuing at a moderate pace thanks to a generally stronger housing sector, which was helping conditions in the labor market improve gradually.
He also repeated that the Fed felt the risks to the economy had decreased since the fall.
But he said higher taxes and cuts in federal spending could exert a larger drag on growth than expected, and that worsening conditions overseas could hurt conditions back home.
"With the recovery still proceeding at only a moderate pace, the economy remains vulnerable to unanticipated shocks, including the possibility that global economic growth may be slower than currently anticipated," Bernanke said.