Amazon surpassed Wal-Mart as the world’s biggest retailer on Friday after reporting a surprise jump in profit in the second quarter.

The e-commerce giant said net income was $92 million, or 19 cents a share, in the three months ended June 30. That’s compared with a net loss of $126 million, or 27 cents a share, in the same period a year ago. Analysts were expecting a loss of 15 cents a share, according to FactSet.

Revenue also jumped 20 percent to $23.2 billion.

That news pushed Amazon stock up as much 20 percent Friday. As of mid-afternoon trading, Amazon was up nearly 11 percent to $533.33. That boosted the company’s market value to about $249 billion, more than Wal-Mart’s market value of nearly $231 billion.

Amazon is trying to venture into areas beyond its domain of books and household goods. The company has gotten into grocery delivery and also offers free movies and TV shows for Amazon Prime members, who pay $99 a year for perks including free two-day shipping.

Amazon has been battling with Wal-Mart and other retailers for shoppers who continue to be reticent about spending.

Wal-Mart is testing a similar free-shipping program for an annual fee of $50.