United States President, Donald Trump. Photo: AFP

US consumer inflation cooled more than expected in June, government data showed Tuesday, as energy costs fell on a temporary easing of the US-Iran war.

However, with oil prices again rising on the renewal of Middle East hostilities, and US President Donald Trump ordering the restart of a blockade of Iranian ports, the progress could be fleeting.

The consumer price index rose 3.5 per cent on a year-on-year basis in June, down from a 4.2 per cent increase in May, according to Labour Department data.

The figure marked a pullback from a three-year high, as a drop in energy costs more than offset upticks in housing and food prices.