Amazon reported earnings for the second quarter of 2018 today, posting an even higher profit than Wall Street analysts estimated thanks in large part to boosts in North American operating income, its highly profitable cloud computing business, and booming sales in its growing ad division. Amazon reported earnings per share of $5.07, more than double of analysts’ estimation of $2.50.

That equates to a quarterly profit of $2.5 billion, Amazon’s highest ever and a staggering 1,200 percent increase from this time a year ago, when the company posted a profit of only $197 million. This is the third consecutive quarter Amazon has posted profit of more than $1 billion, and the first time it has ever broken $2 billion. Helping its numbers is Amazon’s fast-growing ad business, which topped $2 billion in sales for the first time this past quarter, a 132 percent year-over-year jump.

Amazon fell just short of revenue expectations by bringing in $52.9 billion instead of the expected $53.41. Yet Amazon Web Services continues to grow at a rapid pace, posting $6 billion in sales compared to $4.1 billion last year at a growth rate just shy of 50 percent. Last quarter, Amazon released the next-generation Fire TV Edition smart TV, including the new Toshiba 4K TV, as well as the Fire TV Cube, helping it in the retail sales department.

This year’s Prime Day was the largest yet, so it’s good news for Amazon all around

Internationally, the segment that Amazon tends to do the worst in, the company managed to spend more and sell more, slimming its net loss to $494 million this year so far, compared to $724 million from this time a year ago. Amazon’s chief financial officer Brian Olsavsky said during the earnings call that “we’re very bullish on international investment.” He credits advertising and marketing for the improved margins and explains that the company will continue to spend more upfront on expansion efforts because “we believe it’s the right thing to do.”

The company also revealed that the recent Prime Day last week was its biggest sale day yet, selling over 100 million products, even though the website crashed at the time the event began. (Prime Day sales aren’t factored into this past quarter’s metrics, and will instead roll over to third quarter of the year.) The company also noted how the event prompted more people to sign up for Prime than any other previous day in the company’s history.

At the time of writing, Amazon’s stock is up 4.4 percent in after-hours trading. The company’s stock is nearing a $1 trillion market value, which would be a first for any global company.

Update July 26th, 6PM ET: This article has been updated with comments from Amazon’s chief financial officer Brian Olsavsky.