WASHINGTON (Reuters) - U.S. producer prices recorded their biggest gain in a year in June as the cost of energy products and services increased, pointing to a steady

build-up in inflation as the drag from a strong dollar and lower oil prices fades.

The Labor Department said on Thursday its producer price index for final demand rose 0.5 percent last month, the largest increase since May 2015, after advancing 0.4 percent in May.

In the 12 months through June, the PPI increased 0.3 percent, rising for the first time since December 2014, after slipping 0.1 percent in May.

Economists polled by Reuters had forecast the PPI gaining 0.3 percent last month and dipping 0.1 percent from a year ago.

The dollar's surge between June 2014 and December 2015 put downward pressure on producer prices, helping to keep inflation below the Federal Reserve's 2 percent target. The greenback's rally has faded this year while oil prices have rebounded from multi-year lows.

Last month, energy prices jumped 4.1 percent after increasing 2.8 percent in May. Prices for services rose 0.4 percent after gaining 0.2 percent in May. Services were boosted by a surge in costs related to securities brokerage and dealing.

Healthcare costs were unchanged as a 0.1 percent rise in doctor visits was offset by weak home healthcare services.

A key measure of underlying producer price pressures that excludes food, energy and trade services rose 0.3 percent last month after edging down 0.1 percent in May. The so-called core PPI was up 0.9 percent in the 12 months through June. The core PPI increased 0.8 percent in May.

(Reporting by Lucia Mutikani; Editing by Paul Simao)