Retail sales in the U.S. surged much more than expected in July, raising the risks that demand-driven inflation will persist or even accelerate and diminishing the chances for a recession in the near term.

Sales at U.S. retailers rose 0.7 percent in July, the biggest gain in six months, data from the Commerce Department showed Tuesday. The prior month’s gain was revised up to 0.3 percent from 0.2 percent.

Economists had forecast a much milder 0.4 percent gain.

Retail sales account for about one-third of consumer spending. Growth in retail sales has weakened in recent months as consumer spending shifted back toward services from the unbalanced tilt toward spending on goods that emerged during the pandemic.

Retail sales are often regarded as a reliable bellwether of the strength of the U.S. economy. The surge in July suggests that consumers are still feeling confident and demand for goods remains high, likely bouyed by the ongoing  strength in the labor market and diminished inflation.

The surge in retail buying, however, risks a revival of inflationary pressures. It suggests that further progress in bringing down inflation may be slower and more volatile than the downshift from last year’s decades-high rate of nearly nine percent. In July, the consumer price index rose 3.2 percent compared with a year earlier and core CPI, which excludes food and energy prices, rose 4.7 percent.

Excluding vehicles, retail sales were up an even stronger one percent, a big jump from 0.2 percent in June and well above estimates for a 0.4 percent gain. Excluding gas and vehicles, sales were up one percent for the month, which compares with estimates of 0.4 percent and a 0.3 percent gain in the prior month.

Sales in what’s known as the “control group” were up one percent, also above estimates and last month’s figure. The control group excludes receipts from auto dealers, building-materials retailers, gas stations, office supply stores, mobile homes, and tobacco stores. It is considered a more measure consumer spending and is used in the calculation of personal consumption expenditures that feeds into gross domestic product estimates.