Prices in the New York metropolitan area rose last month compared with a year earlier on the higher costs of gasoline and housing.

The federal Bureau of Labor Statistics reported Tuesday that its consumer price index for the 31-county region that includes Long Island climbed 1.7 percent in June compared with the same time a year ago.

advertisement | advertise on newsday

Martin Kohli, the bureau's chief regional economist, said monthly increases in the index, year over year, have been 2 percent or less since December 2013. The Federal Reserve, which sets the nation's interest rates, considers inflation to be optimal if the index is about 2 percent nationally.

In the New York area, grocery prices rose 1.6 percent last month compared with June 2013.

The cost of housing was up 3 percent, year over year.

Prices for gasoline and electricity each climbed 3.6 percent while those for natural gas were down 4.7 percent.

advertisement | advertise on newsday

Health care cost 2.8 percent more, year over year, while prices for apparel and home furnishings fell 2 percent and 2.4 percent, respectively.