Uncovering and explaining how our digital world is changing — and changing us.

Amazon stock soared more than 12 percent in after-market trading as the company posted first-quarter financial results that easily beat analyst expectations.

Amazon recorded a profit of $1.07 per share in the quarter on revenue $29.1 billion, which was a 29 percent increase over the same period last year. Analysts had estimated a profit of 58 cents a share on about $28 billion in revenue.

The quarterly results mark the first time since 2012 that Amazon has turned a profit in four straight quarters — a scary proposition for competitors who can no longer say that Amazon is completely sacrificing profitability for growth.

Amazon’s fast-growing AWS cloud computing segment posted revenue of about $2.6 billion, which was a 64 percent increase from last year and in line with expectations. Amazon CEO Jeff Bezos has said AWS will soon be a $10 billion revenue business on an annual basis. The unit’s operating profit margin was 28 percent, excluding stock-based compensation, up from 17 percent a year ago, but down slightly from 29 percent last quarter.

Amazon’s core e-commerce business continues to grow rapidly in North America — 32 percent in the quarter — on the back of its Prime membership program, which offers unlimited express delivery on millions of products. Prime has at least 46 million members worldwide based on the few growth figures Amazon has disclosed.

Correction: The story originally compared this quarter’s AWS operating profit margin after taking into account stock-based compensation with operating profits from past quarters that did not account for stock-based compensation.