U.S. consumer prices rose at a slower-than-expected pace in May despite higher gasoline costs, and fell over the past 12 months by the most since 1950, according to government data on Wednesday.

The Labor Department said its closely watched Consumer Price Index edged up 0.1 percent after being flat in April, below market expectations for a 0.3 percent increase. Compared to the same period last year, consumer prices fell 1.3 percent, the largest decline since April 1950.

This should help to take some of the inflation concerns out of the Treasury market, said Sacha Tihanyi, currency strategist at Scotia Capital in Toronto.

U.S. stock indexes were barely higher, while Treasury debt prices trimmed losses on the data.

Core prices, which exclude food and energy items, rose at a slower 0.1 percent versus a 0.3 percent increase in April, in line with analysts' predictions. Prices for tobacco and smoking products fell after surging in the last two months on the back of a federal excise tax increase.

The rise in the monthly core CPI was the smallest advance since December 2008.

The increase came as new vehicle prices rose for a fifth straight month. Shelter and medical costs also contributed to the gain in the core CPI index.

Core prices increased 1.8 percent year-over-year after a 1.9 percent rise in April. Gasoline prices rose 3.1 percent versus a 2.8 percent drop the previous month.

The food index fell 0.2 percent in May, declining by the same margin for two straight months.

(Reporting by Lucia Mutikani, Editing by Chizu Nomiyama)