Americans curtailed their shopping in June, with less spending at restaurants, department stores and gasoline stations. The spending pullback came despite a healthy job market and suggests that economic growth could remain sluggish.

Retail sales fell 0.2 percent after declining 0.1 percent in May, the Commerce Department said Friday. Spending at retailers has grown 2.8 percent over the past 12 months, a relatively modest pace given that the sales figures aren’t adjusted for inflation.

Michael Dolega, a senior economist at TD Bank, called the report “a disappointment as far as the resilience of the consumer is concerned.”

The decline reflects in part a transformative shift by consumers toward Amazon and other online retailers. Sales at department stores, once the anchors of shopping malls and the pride of local communities, have dwindled. The rise of online shopping has left more retailers competing on price…