Rising prices for food, fuel, shelter and medical needs kept the annual measure of US consumer inflation at a six-year high in June, the Labor Department said today. 

The upward pressure on prices in the world's largest economy was apparent even excluding the volatile categories of food and fuel, suggesting the underlying trend could be sustained in the coming months. 

The price gains come as President Donald Trump redoubles his trade wars with major US trading partners, which economists say could soon fuel price increases. 

Washing machines, for instance, saw a record price surge following the tariffs Trump imposed in January, growing by 2.8% - the biggest increase since the Labor Department started tracking them in December 1977.  

A monthly dip in electricity and natural gas prices weighed on the consumer price index for June, which rose 0.1% compared to May, slightly slower than economists expected.

The modest raise came despite a 0.5% jump in the index for petrol.

For the last 12 months the consumer price index, which tracks prices for household goods and services, was 2.9% higher, the same as in May which was the highest rate since February 2012.

Excluding food and fuel, however, the "core" index rose 0.2% for June, matching analysts' expectations on higher costs for medical care, cars and recreation. 

Costs for clothing, air fares and furniture fell. 

But core inflation rose 2.3% compared to June of last year, its largest gain since January 2017.

The Federal Reserve will keep a close eye on the rising price pressures. 

The Fed is expected to raise benchmark lending rates twice more this year, anticipating that years of steady growth and falling unemployment will at long last drive inflation higher.