Economists had expected a Consumer Prices Index rate of 2.4%. The pound rose after the data was released by the Office for National Statistics.
Wages are still rising more than inflation, with data last week showing wages, excluding bonuses, grew by 2.9% in the three months to July.
Rising prices for recreational goods, transport and clothing drove the rise.
In July, CPI was 2.5%, which had been the first jump in the index since November.
“However, mobile phone charges, and furniture and household goods had a downward effect on inflation.”
Prices rose less sharply for furniture, household goods and communications.
The year-on-year rise in CPI in August meant that inflation was narrowing the gap with wage increases, with economists waiting for the August earnings figures.
“Today’s inflation data show the rate of price growth accelerated in August, and may well prove to have exceeded total earnings growth in the same period. Unless UK workers can increase their productivity, this trend is likely to continue – squeezing living standards over the medium term,” said Alastair Neame, senior economist at the Centre for Economics and Business Research.
Sterling rose to $1.32 following the news, its highest level since July.
“The numbers reinforce expectations that policymakers will gently lift interest rates over the next couple of years,” said Ben Brettell, senior economist at Hargreaves Lansdown.
The Bank of England raised its key interest rate for only the second time in a decade last month. The current interest rate of 0.75% is the highest since March 2009.
It has also forecast that inflation will fall back to the target rate of 2% by 2020.
“The figures won’t come as welcome news to the Bank of England, though – they’ll be desperate to leave policy unchanged until we get some clarity over Brexit and won’t want to be forced into a rate rise by accelerating prices,” said Mr Brettell.
The CPI measure reached 3.1% in November 2017, when price rises were fuelled by the weakness in the pound following the Brexit vote.
In August, the largest change in prices was in the cultural services sector, where theatre tickets rose, and also games, toys and hobbies, while prices for computer goods rose after falling a year ago.
The ONS said transport costs as a component of inflation increased, largely because of rises in the sea and airfares. Petrol prices, though, rose by 1.4 pence between July and August, less than the 1.8 pence rise of a year earlier.
The average price of clothing and footwear rose 3.1% between July and August, faster than the 2.4% a year before. While clothing prices usually rise between July and August, the ONS said women’s and children’s clothing drove the rise.
Howard Archer, the chief economic adviser to the EY Item Club, said the fact that the inflation rise was fuelled by the reaction and cultural goods meant it would be temporary.
“We would expect this to unwind in next month’s release,” Mr Archer said.
The Retail Prices Index (RPI), a separate measure of inflation, was 3.5% in August, up from 3.2% in July.