Retail sales increased 0.2% last month, the Commerce Department said on Tuesday.
Data for May was revised higher to show sales gaining 0.5% instead of 0.3% as previously reported.
Economists polled by Reuters had forecast retail sales gaining 0.5%.
Food services and drinking places are the only services category in the retail sales report.
Spending has remained resilient despite 500 basis points worth of interest rate hikes from the Federal Reserve since March 2022, when the US central bank kicked off its fastest monetary policy tightening cycle in more than 40 years.
A tight labour market continues to boost wage gains while some households still have savings accumulated during the COVID-19 pandemic.
Consumers' purchasing power is also gradually improving as inflation subsides.
Excluding automobiles, gasoline, building materials and food services, retail sales increased 0.6% in June.
Data for May was revised slightly up to show these so-called core retail sales increasing 0.3% instead of the previously reported 0.2%.
Core retail sales correspond most closely with the consumer spending component of gross domestic product.
June's solid rise and May's upward revision to core retail sales in May suggest that consumer spending, which accounts for more than two-thirds of the US economy, continued to grow last quarter.
The pace was, however, probably slower than the first quarter's rate, which was fastest pace in nearly two years.
Economic growth estimates for the second quarter are currently as high as a 2.3% annualised rate.
The economy grew at a 2.0% pace in the January-March quarter.