U.S. retail sales rose at a solid pace last month, providing crucial support to the economy at a time when other drivers of growth have faded.

The Commerce Department said Tuesday that retail sales rose 0.4% last month, the fourth straight increase. Sales at online retailers, grocery stores, home and garden stores, and at restaurants and bars all increased at a healthy pace.

June’s figures underscore the importance of consumer spending to the U.S. economy. Business investment has weakened, factory output has faltered, and slower global growth is weighing on exports. But measures of consumer confidence remain historically high and June’s retail sales figures suggest that consumer spending, which drives two-thirds of the economy, remains strong.

Retail sales account for about one-third of Americans’ spending, while the other two-thirds are in services.

June’s figures will likely lift many analysts’ forecasts for growth in the April-June quarter. Analysts expect the economy to expand at an annual rate of 1.5% to 2% in the second quarter, down from 3.1% in the first quarter. But the retail sales figures were better than many economists expected.

So far, consumer spending has remained healthy despite the hefty tariffs imposed on billions of dollars of imports as part of President Trump’s trade fights. Consumers are also defying, for now, fears that their spending would decline as the impact of Trump’s tax cuts wanes.

A category that is mostly made up of online retail sales jumped 1.7% for the second month in a row, pushing the annual gain to 13.4%, a testament to the ongoing strength of online retailers. Spending at restaurant and bars increased 0.9%, a healthy showing in an area that is a discretionary expense. Spending at grocery stores rose 0.5%.

US Industrial Production Unchanged in June

U.S. industrial production was flat in June, as a slump in utilities was offset by gains in output by factories and mining.

The Federal Reserve said Tuesday that manufacturing production increased 0.4% last month, aided by a nearly 3% surge at auto plants. Still, factory output has been weak over the past 12 months, posting a modest gain of just 0.4%. The manufacturing sector has faced challenges because of President Donald Trump’s tariffs against China and the retaliatory taxes imposed by that country.

Production at the nation’s utilities fell 3.6%, as a milder than usual June led to less demand for air conditioning. Production at mines, a sector that also covers oil and gas drilling, advanced a modest 0.2%.

Capacity utilization fell in June to 77.9% from 78.1% in May.

The weakness in manufacturing has held back industrial output. During the April-June quarter, industrial production tumbled at an annual rate of 1.2%, the second straight quarterly decline. The April-June quarter saw sharp decreases in the making of machinery, motor vehicles, fabricated metals, textiles, paper and plastics and rubber products, among other goods.

The import taxes on roughly $250 billion worth of Chinese goods have increased the costs for manufacturers that rely on foreign components, as well as created uncertainties about a global supply chain that keeps factory output steady. The Trump administration has relied on tariffs as leverage for causing China to trade on more favorable terms with the United States.

© The Associated Press. All rights reserved.