Amazon was anything but amazing on Thursday as it reported second-quarter earnings that came in 72 percent below expectations.

The dizzying miss sent shares of Jeff Bezos’ e-commerce juggernaut tumbling 3.2 percent in after-hours trading, to $1,012.30.

Amazon’s revenue of $38 billion, up 25 percent, did beat the analyst consensus of $37.2 billion — but the company’s runaway spending, which had been under control of late, appeared to return.

Its earnings per share of only 40 cents was woefully short of the expected $1.42.

CEO Bezos has a reputation for lavish spending — focusing on the long-term rather than quarterly results, as he tries to dominate such diverse categories as retail, entertainment and cloud computing.

“What you’re buying it for is top-line growth, revenue growth, market share — and I suspect when you go through the numbers you’re going to see Amazon is making great progress,” Michael Yoshikami of Destination Wealth Management said during a CNBC interview.

Amazon Web Services, the Seattle company’s cloud platform, was the quarter’s growth driver, despite representing only 11 percent of the sales mix.

AWS revenue shot up 42 percent, to $4.1 billion, and delivered a 28 percent increase in operating income, to $916 million.

That was more than the combined operating-income contributions of Amazon’s other two segments: North America, with $436 million, and International, with a loss of $724 million.

CFO Brian Olsavsky, the only Amazon executive to participate in the company’s conference call, described the adoption rate of AWS by individual, corporate and government subscribers as “phenomenal.”

Yet he acknowledged the segment had a 47 percent increase in expenses, reflecting the hiring of software engineers and sales teams to maintain AWS’ lead over such competitive upstarts as Google and Microsoft.

That AWS is holding its own was evident in the segment’s strong revenue gain — despite significant price decreases and the introduction of services that cannibalized their more expensive predecessors, Olsavsky said.

As for retail, the CFO said the company looked forward to closing on last month’s agreement to buy Whole Foods for $14 billion.

“They’re very customer-centric — just like us,” he said.

But he deflected questions about the effect of Whole Foods on Amazon Fresh — the company’s burgeoning grocery-delivery and pickup service in select cities.

“We’re experimenting with a number of formats,” he said before admitting Amazon “hadn’t nailed” the perfect configuration.

Olsavsky said the company continues to experiment with bookstores as well, calling its eight brick-and-mortar outlets across the US promising showcases to display such Amazon devices as Echo.

The CFO then warned that Amazon would spend even more this quarter on entertainment — an initiative that last quarter earned 16 Emmy nominations for Amazon Video and resulted in the theatrical release of acclaimed “The Big Sick” by Amazon Studios.