Sales during the holiday shopping season rose 5.1 percent to over $850 billion in 2018, the strongest in the past six years, according to a Mastercard report, as shoppers were encouraged by a robust economy and early discounts.

The data includes in-store and online sales between Nov. 1 and Dec. 24. The National Retail Federation had forecast U.S. holiday retail sales to rise between 4.3 percent and 4.8 percent in November and December.

“From shopping aisles to online carts, consumer confidence translated into holiday cheer for retail,” said Steve Sadove, senior adviser for Mastercard.

Near full employment and rising wages have boosted consumer spending, which in October hit its highest in nearly two decades.

The data also indicated that consumer confidence was not dented by recent volatility in the stock markets and worries over slowing global growth.

With Christmas Eve falling on a Monday this year, customers got an extra day for shopping.

Not surprisingly, online sales posted strong gains, rising 19.1 percent, according to the SpendingPulse retail report, published by Mastercard’s analytics arm.

Amazon said on Wednesday it had a “record-breaking” holiday season, with a billion items shipped for free with Prime in the United States alone.

The company’s shares rose 2 percent in early trading.

In contrast, sales at department stores slipped 1.3 percent, after two years of below 2 percent growth, largely due to store closures. But online sales grew 10.2 percent for the group, indicating heavy investments in e-commerce to tackle continuing drop in store traffic was bearing fruit.

Apparel and home improvement spending had a strong season with growth of 7.9 percent and 9 percent, respectively. But sales of electronics and appliances dipped 0.7 percent, compared with a 7.5 percent rise last year.

The SpendingPulse report tracks spending by combining sales activity in Mastercard’s payments network with estimates of cash and other payment forms, and excludes automobile sales.