American households increasingly relied on their credit cards this spring as prices rose at the fastest rate in four decades.

Credit card balances jumped $46 billion in the second quarter of the year. Compared with a year ago, balances are up 13 percent, the largest increase in more than 20 years, according to data released Tuesday by the Federal Reserve Bank of New York.

Credit card balances typically rise in the April through June period. This year’s increase was driven by the highest rate of inflation in 40 years. The Consumer Price Index was up 8.6 percent in the quarter compared with a year earlier, the biggest increase since the fourth quarter of 1981.

Gasoline prices, which rose to record highs in the period, are also driving up spending. Food prices were up 10.4 percent compared with a year ago, the most inflation since 1979. Consumers are also spending more on services and travel. Total consumer spending rose 1.1 percent in June, 0.3 percent in May, and 0.5 percent in April.

Incomes have not kept up with inflation. Real average weekly wages fell one percent in June, 0.9 percent May, and were flat in April. Weekly earnings in June were 4.4 percent below the year-earlier level after adjusting for inflation.

Despite the increase, credit card balances remain slightly below their pre-pandemic level, the New York Fed said.