By MARTIN CRUTSINGER

AP Economics Writer

WASHINGTON (AP) _ U.S. consumer prices rose in July at the slowest pace in five months, held back by a drop in gasoline prices.

Consumer prices edged up a seasonally adjusted 0.1 percent last month, after larger gains of 0.3 percent in June and 0.4 percent in May, the Labor Department reported Tuesday. It was the smallest increase since a similar 0.1 percent rise in February.

The July price restraint came from falling gasoline prices, which had surged in June. All energy prices were down 0.3 percent and this helped offset a 0.4 percent rise in food costs, which have been pushed up by adverse weather including a drought in California.

Over the past 12 months, consumer inflation is up 2 percent while inflation excluding food and energy is up 1.9 percent. Price gains around 2 percent are considered moderate and meet the 2 percent inflation target set by the Federal Reserve.

Analysts believe overall prices will moderate further in coming months, helped by moderation in energy costs. AAA reports that the nationwide average for a gallon of regular gasoline dipped to $3.45 on Monday, down 13 cents in the past month.

Gas prices are also lower than a year ago, when a gallon of regular cost $3.54. That fall in gasoline prices is one reason for the optimism of economists that consumer spending will show solid gains in coming months. A drop in gasoline prices means consumers will have more to spend on other items.

For July, the 0.4 percent rise in food costs was the fifth increase of that size or higher in the last six months. Food prices have been pushed higher by adverse weather conditions including a severe drought in California.

The drop in energy costs also helped to push down airline ticket prices, which fell 5.9 percent in July after rising 10.9 percent over the previous five months. The price of used cars was down 0.3 percent last month, the third consecutive drop. New car prices rose 0.3 percent after having fallen in June.

The Labor Department reported last week that its producer price index rose just 0.1 percent in July following a 0.4 percent gain in June. This index measures the cost of goods and services before they reach consumers.

The Federal Reserve strives to achieve a 2 percent target for inflation. Until recently, price increases by its favorite inflation gauge were rising around 1 percent, well below the Fed’s target. While this inflation gauge showed a 12-month gain of 1.6 percent in June, that remains comfortably below the Fed’s target and is giving the central bank the leeway to keep interest rates at record lows to boost the economy.

Fed Chair Janet Yellen has continued to stress that while there have been improvements in the unemployment rate, many indicators of the labor market remain weak. She has cited still-high levels of people out of work six months or longer, large numbers of people being forced to work part-time who would like full-time work and persistent weak wage growth.

Yellen will deliver the keynote address at an annual conference sponsored by the Kansas City Federal Reserve Bank in Jackson Hole, Wyoming, on Friday.

Financial markets will watch those comments closely for any hints that Yellen is considering moving up the timing for the Fed’s first rate hike since the recession. Many economists still believe that the Fed will not start boosting its key short-term interest rate, which has been at a record low near zero since late 2008, until the middle of next year.