Reports showing a moderate rise in a key U.S. inflation gauge and continued manufacturing gains helped fire investor optimism on Friday, despite signs consumers' spirits were dampened by higher gasoline prices.

A steady rise in food and energy costs pushed overall U.S. consumer prices up 0.7 percent in May, the sharpest rise in 1-1/2 years, a government report showed on Friday.

However, the core measure of the Labor Department's Consumer Price Index, which removes food and energy, rose just 0.1 percent, below Wall Street's median forecast of 0.2 percent.

With volatile food and energy costs out of the picture, the muted price gains reassured financial markets that inflation remain under control. U.S. stock and bond prices rose solidly in early trading, while the dollar was pressured by the soft inflation data.

A year-on-year rise in core CPI of 2.2 percent was the lowest since 2.1 percent in March 2006.

It's good news for the Fed. I still think they (will) worry a bit about inflationary pressures if growth were to pick up, but there is probably a bit more concern about the housing market given the rise in long-term (interest) rates over the last few weeks, said Scott Brown, chief economists at Raymond James & Associates in St. Petersburg, Florida.

The Federal Reserve has held benchmark U.S. interest rates steady at 5.25 percent since last August, though a sell-off in the U.S. bond market over the past week has pushed yields to five-year highs and renewed concerns about inflation.

Bond prices and yields move inversely.

The Fed reported that May industrial output was flat and that businesses were running at 81.3 percent of capacity last month, partly because utility companies cut output and auto producers turned out fewer new vehicles.

There was no sign of letup in foreign interest in investing in U.S. securities, according to a Treasury Department report that showed a net $111.8 billion were bought in April, up from $30.1 billion in March.

Net long-term capital inflows rose to $84.1 billion in April from $51.2 billion in March. The United States needs to attract foreign capital to cover its large budget and trade deficits.

One sour note came in a Reuters/University of Michigan consumer sentiment survey showing reduced optimism in June that potentially reflects growing strain on household budgets from costlier food and energy.

The consumer sentiment index slipped to 83.7 in June from 88.3 in May and was far below forecasts for a reading of 88.

In a separate report, the Commerce Department said the U.S. current account deficit widened in the first quarter of 2007 to $192.6 billion from a downwardly revised estimate of $187.9 billion for the final three months of 2006.

Analysts surveyed before Friday's report called for a bigger first-quarter shortfall of $201 billion.

The current account is the broadest measure of U.S. trade with the rest of the world. It includes trade in goods, service and capital and financial flows such as foreign purchases of U.S. Treasury bonds to help finance the U.S. trade deficit.

Elsewhere, the New York Federal Reserve Bank said New York state factory activity in June rose to its highest in a year after languishing for the prior three months.

The Empire State general business conditions index jumped to 25.75 in June from 8.03 in May. Economists polled by Reuters had expected a 10.8 reading for June.