WASHINGTON, June 16 (Reuters) - - U.S. consumer prices moderated in May, but sustained increases in housing and healthcare costs kept underlying inflation supported, which could allow the Federal Reserve to raise interest rates this year.

The fresh produce section is seen at a Walmart Supercenter in Rogers, Arkansas June 6, 2013. REUTERS/Rick Wilking

The Labor Department said on Thursday its Consumer Price Index increased 0.2 percent last month after rising 0.4 percent in April. In the 12 months through May, the CPI advanced 1.0 percent after rising 1.1 percent in April.

Economists had forecast the CPI gaining 0.3 percent last month and advancing 1.1 percent from a year ago.

The so-called core CPI, which strips out food and energy costs, rose 0.2 percent after a similar gain in April. That took the year-on-year core CPI rise to 2.2 percent from 2.1 percent in April.

The Fed has a 2 percent inflation target and tracks an inflation measure which is currently at 1.6 percent. The U.S. central bank on Wednesday kept interest rates unchanged and said it expected inflation to remain below its target through 2017.

While the Fed signaled it still planned two rate hikes this year, there was less conviction, with six officials expecting only a single increase, up from one in March.

The Fed raised its benchmark overnight interest rate in December for the first time in nearly a decade.

Last month, gasoline prices rose 2.3 percent after surging 8.1 percent in April. Food prices fell 0.2 percent, reversing the prior month’s increase.

Within the core CPI basket, housing and medical costs maintained their upward trend. Owners’ equivalent rent of primary residence rose 0.3 percent after rising by the same margin in April.

Medical care costs increased 0.3 percent after a similar gain in April. The cost of hospital services shot up 0.7 percent after rising 0.3 percent the prior month. Doctor visit costs rose 1.0 percent, but the cost of prescription medicine fell 0.4 percent after increasing 0.7 percent in April.

Apparel prices rose 0.8 percent. The cost of used cars and trucks dropped 1.3 percent, the biggest fall since March 2009. Prices for new motor vehicles fell 0.1 percent.