Consumer prices in the metropolitan area rose modestly last month compared with a year ago as higher costs of medical care and residential rents were offset by lower prices for groceries and gasoline.

The federal Bureau of Labor Statistics reported Tuesday that its consumer price index for the 31-county region that includes Long Island climbed 1 percent in July compared with a year earlier.

Year-over-year changes in the index have been 1 percent or less since November 2014, according to Martin Kohli, the bureau’s chief regional economist.

In July, health care prices increased 6.1 percent compared with a year ago.

The cost of residential rents was up 3.5 percent, year over year.

Offsetting these increases, somewhat, were lower prices for energy and groceries.

The cost of gasoline fell 18.3 percent between last month and July 2015. Electricity was down 2.6 percent in the same period while natural gas was up 2.3 percent.

advertisement | advertise on newsday

Grocery prices declined 1.6 percent in July compared with a year ago. However, restaurant meals cost 3.5 percent more than in 2015.