Amazon reported total revenue of $70 billion in the third quarter, up 24% from the same period a year ago and more than $1 billion ahead of Wall Street analysts’ estimates.

But downturns in operating and net income undershot estimates as the retail behemoth funnels significant resources into one-day delivery, an as-yet unproven strategy. The miss — and the company’s first quarterly profit decline in two years — sent the company’s shares down 7% in after-hours trading.

Operating income decreased to $3.2 billion from $3.7 billion a year ago, and net income fell to $4.23 per share on a diluted basis, well below the consensus estimate of $4.62 and down from $5.75 in the 2018 period.

Amazon has faced questions from Wall Street analysts in recent quarters as it has boosted spending on one-day delivery, a step change from the standard two days promised to Prime members. The tab for one-day delivery has reached $800 million over the past two quarters.

Related Story "Alexa, I'm Being Pulled Over": Amazon Unveils New Products Like Ring Traffic Stop, Netflix-Enabled Echo Show, Fire TV Upgrade, Alexa Privacy Tools

Before the after-hours selloff, Amazon stock had risen 17% in 2019 to date, a bit less than the 20% gain for the S&P 500.

Founder and CEO Jeff Bezos said in the company’s earnings release that the heavy spending was timed to pay dividends in the high-priority fourth quarter, when holiday spending always fills the company’s coffers. Plus, he argued, faster shipping is better for the environment.

“We are ramping up to make our 25th holiday season the best ever for Prime customers — with millions of products available for free one-day delivery,” Bezos said. “Customers love the transition of Prime from two days to one day — they’ve already ordered billions of items with free one-day delivery this year.

“It’s a big investment, and it’s the right long-term decision for customers. And although it’s counterintuitive, the fastest delivery speeds generate the least carbon emissions because these products ship from fulfillment centers very close to the customer — it simply becomes impractical to use air or long ground routes.”