Consumer prices in the metropolitan area rose last month at their fastest rate in nearly five years on higher costs for gasoline and other energy sources.

The federal Bureau of Labor Statistics reported yesterday its consumer price index for the 31-county region that includes Long Island increased 2.6 percent in February from February 2016.

That is the largest year-over-year increase in the price index since March 2012, when it also rose 2.6 percent.

The February year-over-year gain follows a similar increase in January and a large rise in December. The figures are not seasonally adjusted.

In February, the cost of gasoline was up 32.9 percent, year over year. Pump prices have been climbing recently after steady declines for more than a year. In another energy area, the cost of natural gas continued to rise, increasing 23.7 percent last month compared with February 2016. It was the largest year-over-year gain in 11 years. A similar 11-year rise was seen in January.

Electricity prices were up 3.3 percent, year over year.

The cost of health care rose 3.7 percent in February from a year ago, while residential rents were up 2.4 percent.

advertisement | advertise on newsday

These increases were partially offset by falling grocery and clothing prices. The cost of groceries fell 1.1 percent in February from a year earlier. Clothing prices were down 0.7 percent.

Nationally, the bureau’s price index rose 2.7 percent last month compared with February 2016. The figure is not seasonally adjusted.

The national gain was driven by increases in the cost of gasoline, home heating oil and natural gas.