New York CNN Business  — 

Amazon’s streak of record profits has come to an end.

Amazon (AMZN) on Thursday reported a profit of $2.6 billion for the three months ending in June — up slightly from the year prior, but well below its record of $3.6 billion set in the first three months of this year. That ends Amazon (AMZN)’s impressive streak of four consecutive quarters of record profits.

The weaker-than-expected profit comes as Amazon is investing heavily in expediting deliveries. The company previously announced that it would spend $800 million during the second quarter to make free one-day shipping standard for its Prime customers, effectively halving the usual shipping window.

On a conference call with analysts after the report Thursday, Amazon CFO Brian Olsavsky said the actual cost of speeding up shipping ended up being “a little bit higher than that number.” The company grappled with “transition costs in our warehouses” as well as “costs from buying more inventory and moving around in network to be closer to customers.”

“It does create a shock to the system,” Olsavsky said on the call. “We are working through that now.”

Charlie O’Shea, an analyst who tracks Amazon for Moody’s, described the substantial investment in one-day shipping as “short-term pain for long-term gain.” While it may hurt profits now, he said it is “a necessary strategy to compete with brick-and-mortar’s speed advantage to the customer.”

Shares of Amazon dipped as much as 3% in after hours trading Thursday following the earnings report’s release before recovering.

The shift to next day deliveries is thought to be key to renewing Amazon’s sales growth at a time when the company is running up against the law of large numbers. Amazon posted revenue of $63.4 billion for the most recent quarter, up 20% from the same period a year ago.

“Customers are responding to Prime’s move to one-day delivery — we’ve received a lot of positive feedback and seen accelerating sales growth,” Jeff Bezos, Amazon founder and CEO, said in a statement Thursday.

Last month, Amazon announced that next-day delivery is now available for more than 10 million Prime members.

On the call, Olsavsky declined to detail how the availability of one-day shipping is shifting the product choices for these millions of customers. But he did stress that “a lot more products enter the consideration set for our customers.”

In addition to enticing customers to shop more with faster and faster shipping, Amazon is also working to boost its overall revenue through a mix of newer services, including cloud computing and advertising.

Amazon Web Services, which remains the leader in the cloud computing market, saw sales grow 37% from the prior year to $8.4 billion. But growth in this segment is gradually slowing too as the company faces stiff competition from Microsoft (MSFT) and Google (GOOG).

Amazon’s “other” revenue category, which is said to be primarily made up of advertising services, hit $3 billion in revenue for the quarter. Its multi-billion dollar advertising business is increasingly competing with the likes of Facebook (FB) and Google.