A motorist pumps fuel into his vehicle at JJ's Express Gas Plus station in Phoenix gas station in Phoenix, Arizona, August 2011 Reuters / Joshua Lott

The U.S. Consumer Price Index (CPI) rose by 0.5 percent in June, according to a report released Tuesday by the Bureau of Labor Statistics, outpacing what a consensus of economists expected for the closely watched inflation gauge.

Analysts polled by Briefing.com expected, on average, the CPI to rise by 0.3 percent in June, up from an increase of 0.1 percent in May.

The CPI, which measures the change in the price of goods and services purchased by consumers during a month, accounts for a majority of overall inflation.

Gasoline prices rose and accounted for about two-thirds of the seasonally adjusted change in all items, while other energy indexes were mixed. The food index increased after declining in May as did the electricity index, yet the natural gas and fuel oil indexes declined.

Consumer items other than food and energy increased 0.2 percent in June, matching the increase in May, spurred mostly by rises in the shelter, medical care and apparel indexes as well as new vehicles and household furnishings. June saw decreases in prices for airline fares, used vehicles and recreation.