on Thursday said profits more than doubled to $1.6 billion in the first quarter, sending shares of its stock soaring to an all-time high.

The company's fast-growing advertising and cloud businesses drove much of its growth, and contributed to its second straight quarter of billion-dollar profits. Overall sales rose 43 percent to $51 billion, up from $35.7 billion a year earlier.

Amazon also said it will hike its Prime membership fee 20 percent to $119 a year for new members beginning May 11. Members who renew their Prime memberships will have to pay the new rate beginning June 16. The company said this month that it has 100 million Prime members, the first time it has released the number.

“The Prime program continues to drive great strength to our top line,” Brian Olsavsky, Amazon’s chief financial officer, said in a Thursday earnings call with analysts.

The Prime membership program has been an important cornerstone of Amazon’s flagship retail business. Prime members receive free two-day shipping on 100 million items, up from 20 million in 2014, Olsavsky said.

[Why you cannot quit Amazon Prime - even if maybe you should]

Shares of Amazon spiked as much as 7 percent to a record $1,619 in after-hours trading, erasing recent losses following tweets from President Trump that attacked the company. The president also launched a study of whether Amazon is getting too good a deal from the U.S. Postal Service. (Jeffrey P. Bezos, the founder and chief executive of Amazon, also owns The Washington Post.)

Amazon, founded 24 years ago as a online bookseller, has grown into a multibillion-dollar tech juggernaut with a hand in several industries, including groceries, private-label clothing and movie production. This year, Amazon announced it was teaming up with Berkshire Hathaway and JP Morgan Chase to create its own independent health-care company.

“Amazon continues the trend of investment-fueled revenue expansion,” Charlie O’Shea, lead retail analyst for Moody’s, wrote in a note to clients. Cash flow “remains formidable, buttressed by $25 billion in cash and short-term investments, providing ample cushion as the company continues to invest across its many platforms.”

But its success has come at the cost of brick-and-mortar retailers, and several competitors have been complaining to government officials that the company is getting too big. Amazon’s success in so many different lines of business has not been easy for regulators to tackle, given that federal antitrust law largely focuses on consolidation within distinct industries.

Amazon Web Services, the cloud platform, continued to bring in the bulk of the company’s profits. That part of the business had a 26 percent operating margin in the most recent quarter, compared to 3.8 percent for the overall company. AWS sales, meanwhile, rose 49 percent to $5.44 billion as thousands of new companies signed up for the service.

“[Amazon Web Services] had the unusual advantage of a seven-year head start before facing like-minded competition, and the team has never slowed down,” Bezos said in a statement. “That’s why you’re seeing this remarkable acceleration in AWS growth, now for two quarters in a row.”

Earlier in the week, Amazon announced it would begin delivering packages to certain vehicles parked at homes, offices and other publicly accessible areas. The program, initially available to Prime members in 37 cities, is the latest effort by the Seattle-based company to make it easier for customers to receive online orders.