last night reported a profit near $2 billion, the largest in the company's history.

The profit rise came as the online retailer drew millions of new customers to its Prime fast-shipping club for the Christmas season and as changes to US tax law added to its bottom line. 

Shares rose more than 6% in extended trading, after previously closing down 4% on the Nasdaq. 

Amazon is using fast shipping, television shows exclusive to its website and forays into new technology, such as its voice-controlled Alexa devices, to attract high-spending Prime members. 

Amazon said price cuts at Whole Foods Market, which it acquired for $13.7 billion last year, are helping it win grocery sales, too. 

The world's largest online retailer said net income more than doubled to $1.86 billion, or $3.75 per share in the fourth quarter ended December 31. 

Its profit received a provisional $789m boost from the US Republican tax bill passed in December. 

Analysts on average were expecting just $1.85 per share, according to Thomson Reuters. 

As expected, the period running from before the US Thanksgiving holiday up to the New Year was Amazon's biggest-ever by revenue. Sales rose 38% to $60.5 billion in the quarter, beating estimates. 

The company's fast delivery, like its two-hour Prime Now service, has helped win over shoppers eager to avoid the crowds of big box retailers. 

Prime saw more than 4 million sign-ups in one week alone last quarter, and revenue from subscription fees grew 49% to $3.2 billion, Amazon said. 

That figure is expected to rise this quarter in part because the company recently raised the fee for month-to-month Prime plans, affecting some 30% of subscribers, according to analysts. 

Some 60 million, or close to half of all US households, are estimated to have Prime subscriptions.

The company said its advertising and other revenue rose 62% to $1.74 billion. 

Brian Olsavsky, Amazon's chief financial officer, said on a call with analysts that advertising was "a key contributor" to the company's growing profit margin. 

Perhaps the surprise star of the past quarter was Amazon's voice aide Alexa, embedded in the company's Echo speakers and Fire TV players, as well as some cars and house gadgets.

Millions of Amazon customers ordered goods by voice with Alexa in the past year, said Olsavsky on a separate call with reporters.

"Our 2017 projections for Alexa were very optimistic, and we far exceeded them," added Jeff Bezos, Amazon's founder and chief executive, in a statement. 

"We don’t see positive surprises of this magnitude very often - expect us to double down," he added.

Amazon's stock has outperformed the S&P 500 index, rising almost 50% since the start of the fourth quarter to last night's close, compared with the S&P's 12 percent rise. 

Amazon Web Services (AWS), which is dueling with Microsoft to handle data and computing for large enterprises, saw its profit margin expand from the third quarter. AWS posted a 45% rise in sales to $5.1 billion. 

Amazon said it expects operating profit in the current quarter of between $300m and $1 billion. Analysts were expecting $1.5 billion, according to analytics firm FactSet. 

Olsavsky, Amazon's CFO, told said that the company are "still in heavy investment mode." 

The company has become notorious for running on a low profit margin. Yet its big bets on new services and entry into new industries have reaped shareholders rewards over the past decade, including its founder Bezos, now the richest man in the world. 

Amazon continues to spend on a wide array of areas. It is expanding its retail footprint outside the US, particularly in India, and almost doubled its international operating loss to $919m in the fourth quarter. 

Amazon's global headcount is up 66% from a year ago at 566,000 full-time and part-time employees, thanks to a hiring spree and an influx of workers from Whole Foods Market.

And earlier this week, it announced a partnership with JPMorgan Chase and Berkshire Hathaway to determine how to cut health costs for hundreds of thousands of their employees. 

The company said it plans to spend more on video content this year as well, with a prequel television series to "The Lord of the Rings" in the works. Analysts estimate Amazon spent $4.5 billion or more in 2017.