U.S. producer prices rose more than expected in June as the cost of gasoline and a range of other goods rose, indicating the recent oil-driven downward spiral in prices was abating.

Other data on Wednesday showed a rebound in industrial production last month and a pick-up in factory activity in New York state in July. The signs of stabilizing manufacturing and firming inflation came as Federal Reserve Chair Janet Yellen said the Fed remained on track to hike interest rates this year.

"Today's data support the Fed chair's message that the economy can support a rate hike," said Joel Naroff, chief economist at Naroff Economic Advisors in Holland, Pennsylvania.

The Labor Department said its producer price index for final demand increased 0.4 percent last month after rising 0.5 percent in May. It was the second straight month of increase in producer prices and beat economist expectations for a 0.2 percent gain.

A 0.7 percent rise in goods prices accounted for nearly two-thirds of the increase in the PPI last month.

Gasoline prices increased 4.3 percent after surging 17 percent in May. The volatile trade services component, which mostly reflects profit margins at retailers and wholesalers, rose 0.2 percent in June after increasing 0.6 percent in May.

A key measure of underlying producer price pressures that excludes food, energy and trade services increased 0.3 percent last month after dipping 0.1 percent in May.

In testimony before the U.S. House of Representatives Financial Services Committee, Yellen affirmed the view of a central bank prepared to gradually raise rates after keeping its short-term lending rate near zero for more than six years.

"If the economy evolves as we expect, economic conditions likely would make it appropriate at some point this year to raise the federal funds rate," Yellen said.



In a second report, the Fed said industrial output rose 0.3 percent in June, the largest increase in seven months, after two straight months of decline. While manufacturing production was flat, that was because of a 3.7 percent decline in motor vehicle output. Excluding automobiles, manufacturing rose 0.3 percent.

The dollar firmed against a basket of currencies on the data and Yellen's comments. Prices for U.S. Treasury debt were marginally lower. Stocks on Wall Street rose slightly.

A plunge in crude oil prices and a resurgent dollar have subdued producer inflation and dampened overall domestic price pressures. Inflation is stabilizing as oil prices steadily rise, but a strong dollar suggests any increase will be gradual.

A report on Tuesday showed broad weakness in import prices in June, underscoring the impact of the dollar's 11.6 percent appreciation against the currencies of the United States' main trading partners since June 2014.

The dollar and lower oil prices have also pressured the manufacturing sector by hurting profits of multinational corporations and undercutting oil drilling activity, which has reduce investment spending in the energy sector.

There are signs, however, that the deep spending cuts in the energy sector are diminishing as oil prices rise.

The industrial output report showed oil and gas well drilling declined only 3.7 percent last month after falling 8.7 percent in May, and well below the monthly average decline of 13.7 percent over the last five months.

"The U.S. oil and gas rig count looks to have stabilized around current levels, suggesting the drag from less energy capital investment in the second quarter should subside in the third quarter," said Jesse Hurwitz, an economist at Barclays in New York.

A report from the New York Fed showed its Empire State general business conditions index rose to 3.86 in July from -1.98 in June, which was its lowest level since January 2013.

A reading above zero indicates expansion. The New York Fed survey's index on future business conditions climbed to 27.04 from June's 25.84, which was the weakest since February. A measure of new orders, however, contracted for a second month. 

By Lucia Mutikani - Reuters  (Additional reporting by Tim Ahmann in Washington andRichard Leong in New York; Editing by Andrea Ricci and Meredith Mazzilli)