Consumer prices rose 1.8 percent over the year to April, pushed up by the cost of food and soft drinks, after a 1.5-percent annual increase the previous month, the National Statistics Institute said in a report, confirming earlier estimates.
Month-on-month, consumer prices rose 0.1 percent in May, unchanged from the pace in April.
Spain's inflation rate leapt when Prime Minister Mariano Rajoy's conservative-leaning government, raised the sales tax in September last year so as to rein in the public deficit.
Spain, the eurozone's fourth-largest economy, has been struggling in recession since 2011, as the government curbs spending and raises taxes.
The unemployment rate shot to a record of more than 27 percent in the first quarter of this year.
Consumer demand has retreated in the face of these headwinds. Retail sales in Spain fell 2.6 percent in April -- the 34th straight monthly decline.