SAN FRANCISCO — Amazon sold a lot of things to a lot of people in the last three months of 2019, as speedy shipping shortened the time between “I want it” and “It’s here.”

That was expected. What no one anticipated was that profits would also shoot up.

On Thursday, Amazon said it had earned $6.47 a share in the quarter, up from $6.04 a year earlier. Analysts had forecast $4.04 a share, and some would not have been surprised if it had been less. Amazon went wide last year with one-day shipping for members of its Prime service, and “fast” is usually synonymous with “expensive.”

Not this time. Amazon said more customers joined Prime in the fourth quarter than ever before, pushing worldwide membership to 150 million households. That total was also more than analysts expected. It was 100 million less than two years ago.

Sales came in at $87.4 billion, up 21 percent from a year earlier and above what Wall Street predicted.