Amazon CEO Andy Jassy has achieved a financial feat this earnings season, as the company experienced strong revenue growth in its core e-commerce business while also cutting spending. As a result, Amazon’s shares rose by approximately 9% when the markets opened on Friday.

Jassy, who took over as CEO two years ago, has taken a pragmatic approach to the world’s largest e-commerce and cloud services company. Under his leadership, Amazon has made significant changes, including firing 27,000 employees, pledging to maintain a flat headcount, discontinuing numerous projects initiated during Jeff Bezos’s tenure, and reviewing multiple businesses.

Investors got a glimpse of the results on Thursday, with second-quarter revenue reaching $134.4 billion, an 11% increase that exceeded expectations. Sales in the online stores category also rose by 4% to $53 billion. Additionally, Amazon’s cloud business, which typically contributes the majority of the company’s operating profit, surpassed expectations and showed signs of stabilization.

“The upturn in Amazon’s e-commerce business is an encouraging sign for the back half of the year that should add to top-line growth,” commented analyst Andrew Lipsman from Insider Intelligence.

Following the positive results, Amazon’s shares surged by 9.1% to $140.67, marking their largest intraday gain since November. The stock has already increased by nearly 68% this year.

Jassy’s decision to reduce expenses has paid off as well. The company’s operating expenses only rose by 7.5% in the three months ending June 30, the slowest rate since at least 2012. Sales and marketing costs increased by just 6.5%, a significant change after years of rising by as much as a third. Consequently, operating income more than doubled to $7.7 billion in the quarter.

Now, with recession fears subsiding and consumers expressing improved confidence in the economy and their personal prospects, Jassy appears ready to reinvest. In an effort to maintain a competitive edge in its core online retail business, Amazon announced plans to double the number of facilities capable of delivering same-day orders to customers. The company is also revamping its grocery operation by offering fresh food delivery to non-Prime subscribers and integrating its Fresh and Whole Foods Market chains more closely.

For the current period ending in September, Amazon projects revenue between $138 billion and $143 billion, surpassing analysts’ average estimate of $138.3 billion. Operating income is expected to range from $5.5 billion to $8.5 billion, compared to analysts’ average projection of $5.41 billion.

The Seattle-based company is increasingly generating revenue from its more profitable services and advertising provided to independent merchants who rent space on Amazon’s website and in its warehouses. Advertising sales rose by 22% to $10.7 billion, while seller services revenue jumped by 18% to $32.3 billion in the quarter.

Chief Financial Officer Brian Olsavsky highlighted that products from independent merchants accounted for 60% of all sales on the site, the highest ever, contributing to the growth of Amazon’s seller-services revenue.

Analyst Lipsman emphasized the strength of the ad business, stating that it “held up especially well this quarter, and the picture should only get brighter in the second half of the year with Prime Day and the holidays adding to its momentum.”

Prior to the results, investors had concerns about Amazon Web Services (AWS), the company’s cloud business. Although growth slowed for a sixth consecutive quarter, the unit still generated more revenue than anticipated, surging by 12% to $22.1 billion.

Olsavsky reassured investors by stating that growth rates for AWS stabilized during the quarter and highlighted a healthy customer pipeline. AWS has been introducing various products based on generative artificial intelligence, although some analysts believe Amazon has fallen behind Microsoft and Alphabet’s Google in this area. Amazon denies this and asserts that the generative AI race has only just begun.

Analyst Brian Yarbrough from Edward D. Jones noted that after several challenging quarters of addressing overspending and excessive hiring, Amazon is now presenting investors with a clear path to increasing sales and profits simultaneously.

“We think there’s a nice long path here for continued growth in retail, continued growth in advertising, and continued growth in cloud computing, all while boosting profits, which is a big change from the past 12 months or so,” Yarbrough said.