Amazon posted earnings for the second quarter of 2017 that fell dramatically short of investor expectations, even as the ecommerce giant boosted revenue 25%.

Net sales roles to $38.0 billion in the second quarter, topping Wall Street estimates, compared with $30.4 billion in the second quarter of 2016.

Amazon’s net income came in at 40 cents per diluted share for Q2, versus $1.78 a year ago, as it ramped up investments. It was Amazon’s ninth straight quarter of profitability, after the company spent years spilling red ink. But Wall Street had expected Amazon to post adjusted earnings per share of $1.42, and shares dropped more than 3% in after-hours trading Thursday after hitting record highs earlier in the day.

For Q2, Amazon’s total operating expenses ballooned to $37.3 billion, up 28% year over year. That included a 43% increase in spending on “technology and content,” to $5.55 billion. Marketing spending in the quarter jumped 44%, to $2.2 billion. Amazon CFO Brian Olsavsky, on a call with analysts, said spending on video content will increase in Q3 on both a sequential and year-over-year basis but he declined to provide specifics.

Amazon is already huge, and it continues to grow bigger. Last month, the company announced a deal to buy Whole Foods for $13.7 billion, which would be the largest acquisition in Amazon’s history.

“Our teams remain heads-down and focused on customers,” Jeff Bezos, Amazon founder and CEO, said in announcing the earnings.

Bezos briefly became the world’s wealthiest individual Thursday — with a net worth of more than $92 billion as Amazon stock surged in the morning — surpassing Microsoft co-founder Bill Gates, according to Forbes. But the company’s shares declined in afternoon trading, putting Bezos back at No. 2.

In his prepared comments, Bezos called out the launch of “Inside Edge” on Amazon Prime Video, a 10-episode series about the worlds of cricket and entertainment, which is the first of 18 Indian original series.

The conglomerate highlighted Amazon Studios’ 16 Emmy Awards nominations this year, including noms for original series “Transparent,” “The Man in the High Castle,” “Mozart in the Jungle,” and “Catastrophe.” It also called out the slate of upcoming originals, including series “The Last Tycoon,” “The Tick,” “The Marvelous Mrs. Maisel,” and the second season of “The Grand Tour.”

Upcoming movies from Amazon Studios set for theatrical debuts include Richard Linklater’s “Last Flag Flying,” Todd Haynes’ “Wonderstruck,” and Woody Allen’s “Wonder Wheel.” Amazon is self-distributing “Wonder Wheel,” selected as the closing-night film of this year’s New York Film Festival, instead of working through other studios.

Overall, the company also hired more than 30,000 new employees in Q2, with 382,400 full- and part-time workers as of the end of June. Amazon also reiterated that it signed up a record number of Prime members on its third annual Prime Day on July 11; however, the company doesn’t disclose how many Prime members it has, while the shopping promo happened in the third quarter.

The Amazon Web Services hosting unit continued to be a standout for the company, with sales up 42% to $4.1 billion. AWS contributed $916 million of operating profit in Q2, rising 28% year over year. Customers of AWS include Comcast, Netflix, Spotify, Discovery Communications, AOL, Condé Nast and Ancestry.