Walmart startled investors on Wednesday by slashing its sales forecast for the year, warning that heavy investments in wages and in e-commerce would curb future earnings.

The news sent Walmart shares plunging, casting a pall over retail stocks, as analysts worried about broader ripple effects across the economy, and about consumer spending ahead of the holiday season.

Walmart’s slowing performance underscored concerns that its superstores, which once upended the way people shopped and for decades dominated the world of retail, are finally succumbing to nimbler rivals in the sprawling world of Internet commerce.

Sales will be flat this year, Walmart said at a meeting with investors in New York. The retailer previously said that it expected net sales to grow 1 to 2 percent for the current fiscal year, through January.