JOHANNESBURG - South Africa's headline consumer inflation quickened more than expected to 6.5% year on year in May from 5.9% in April, data from the statistics agency showed on Wednesday.

Analysts polled by Reuters had predicted inflation would pick up to 6.2% in annual terms.

May's reading marks the first time in more than five years that inflation has breached the upper limit of the central bank's 3%-6% target range.

The South African Reserve Bank has raised rates at its last four monetary policy meetings to try to cool price pressures, with last month's move the first time it had hiked rates by 50 basis points since 2016.

Inflation has been driven higher in recent months by rising fuel and food prices linked to the war in Ukraine.

On a month-on-month basis, May consumer inflation was at 0.7% from 0.6% the previous month.

Core inflation, which excludes prices of food, non-alcoholic beverages, fuel and energy, rose to 4.1% year on year in May, from 3.9% previously. On a month-on-month basis core inflation was at 0.2% from 0.4% in April.

(Reporting by Alexander Winning; Editing by Estelle Shirbon)