(Reuters) - Walmart Inc WMT.N on Tuesday forecast online sales growth to slow this year after posting lower-than-expected holiday quarter results, revealing the pressure traditional retailers are facing to keep pace with consumers who are increasingly shopping online.

Target Corp TGT.N, Kohl's Corp KSS.N and Macy's Inc M.N also posted disappointing holiday sales in 2019, while Amazon.com AMZN.O logged record sales for the period.

Heavy investments to spruce up stores, enhance websites, improve delivery options and promote deals underscore the battle retailers are up against as they try to keep shoppers from going to Amazon.

“Walmart’s results show it’s a food fight out there, with Amazon re-accelerating holiday sales growth,” Evercore analyst Greg Melich said on Tuesday.

Walmart said it expects online sales to grow about 30% in fiscal 2021, down from last year’s growth of 37%. For the holiday quarter, the company reported a 35% increase in online sales - the slowest in nearly two years.

For interactive graphic, click: tmsnrt.rs/2uMZkaV

Sales at Walmart’s U.S. stores open at least a year rose by a weaker-than-expected 1.9%, excluding fuel, in the fourth quarter ended Jan. 31. Results were hit by a shorter holiday season and lower demand for apparel, toys and electronics.

FILE PHOTO: A customer pays for her groceries after shopping at a Walmart store ahead of the Thanksgiving holiday in Chicago, Illinois, U.S. November 27, 2019. REUTERS/Kamil Krzaczynski/File Photo

“There were few weeks before Christmas where general merchandise sales and few categories in the stores were softer than anticipated and it was pretty much limited to apparel, toys, media and gaming,” Chief Financial Officer Brett Biggs told Reuters.

“There were some things in apparel, which we could have done differently in hindsight. We were a little more seasonal there than we should have been,” he added.

Despite a weak holiday for toys and clothes, Walmart’s grocery operation, its largest business, helped drive growth in online sales in the quarter.

Walmart has been expanding store capabilities to push speedy delivery and pickup services for groceries as it competes with similar options from Amazon and Target.

The company also said it would expand the services to add general merchandise items such as t-shirts and charger cables and not just groceries in a bid to boost online orders.

“We feel good about the year though our fourth quarter was not our best,” Chief Executive Officer Doug McMillon said.

The company forecast full-year profit to be between $5 and $5.15 per share, below expectations of $5.22, while it expects U.S. comparable sales to grow at least 2.5%.

The forecast excludes any potential financial hit from the coronavirus outbreak in China, Walmart said. However, it expected some financial impact in the current quarter and potentially into the second quarter from the epidemic.

Walmart shares were up marginally at $118.44.

Adjusted earnings per share increased to $1.38 per share, but missed the average estimate of $1.43.

Total revenue rose 2.1% to $141.67 billion, missing the estimate of $142.49 billion.