(Adds details, market and analyst reaction)

WASHINGTON, July 15 (Reuters) - U.S. producer prices rose a far larger-than-expected 1.8 percent in June as energy costs soared, but core inflation at the producer level edged up just 0.2 percent, Labor Department data showed on Tuesday.

Economists polled by Reuters had expected producer prices -- a gauge of costs at the farm and factory gate -- to rise by 1.3 percent overall after a 1.4 percent increase in May. Energy prices were up 6.0 percent in June, the largest gain since November 2007.

The Labor Department said producer prices over the last 12 months were up 9.2 percent, the biggest increase since a 10.4 percent gain in June 1981.

On year, energy prices were up 27 percent.

Core producer prices, which strip out volatile energy and food costs, increased by 0.2 percent, the same margin as in May. Economists had expected core prices to rise 0.3 percent in June. On a year-over-year basis, core prices were up 3.0 percent.

Financial markets mostly shrugged off the price data, focusing instead on news of weaker-than-expected U.S. retail sales in June. U.S. Treasury bonds added to their gains, and interest rate futures showed that traders saw the chances of the Federal Reserve raising rates at its next meeting at a scant 5 percent.

Stock futures were little changed.

The Fed has slashed its key interest rate by 3.25 percentage points to 2 percent since September in several moves, but opted at its June meeting to keep rates on hold as it assessed the economic situation.

Despite the startling rise in producer prices, economists said it would be difficult for the central bank to raise rates to counter inflationary pressures at a time when the U.S. economy remained weak and global financial markets under stress.

“When you see a massive financial meltdown on a global scale, it does make it quite hard for them to seriously talk about raising rates,” said T.J. Marta, fixed-income strategist at RBC Capital Markets in New York.