AP Technology Writer

NEW YORK (AP) _ It’s official: Amazon is bigger than Wal-Mart.

Amazon shares surged almost 10 percent on Friday after the e-commerce powerhouse reported a surprise second-quarter profit and a better-than-expected 20 percent jump in revenue.

The sharp increase in shares brought Amazon’s market value to $247.77 billion, more than its biggest rival, Wal-Mart Stores Inc., signaling a sea change in retailing. Amazon, which just turned 20, is now valued higher than the world’s largest retailer.

Bentonville, Arkansas-based Wal-Mart Stores is valued at about $230.53 billion. The company, with 11,767 stores worldwide, still has much higher sales, $485.65 billion in the year ended Jan. 31, compared with Amazon’s $89 billion in annual revenue last year.

But investors applauded Amazon’s ability to keep costs in check while growing its revenue. Amazon credited the profit to continued strength of its cloud-computing business and strong revenue growth both domestically and abroad. That came as it held costs for marketing and package delivery in check.

A company’s market value is calculated by multiplying the number of shares of stock it has in circulation by the current price of one share.

It was the second usurper in two months to Wal-Mart’s value. Last month Facebook became more highly valued than the world’s largest retailer, knocking it out of the top 10 list of the highest-valued companies in the Standard & Poor’s 500 index.

Amazon is firing on all cylinders, analysts said.

“When it is good, it is great: particularly as the business shifted to higher growth across a matrix of operating segments, product categories, and geographies in the second quarter,” said William Blair analyst Mark Miller. He said a variety of Amazon’s units boosted results: its $99 annual Prime membership, third-party sellers, and its logistics and delivery capabilities.

“In view of the sharply higher preopening stock price, the question is whether this is as good as it gets,” he added.

Amazon Web Services, the Seattle company’s cloud-computing business, was another standout, with revenue that jumped 81 percent to $1.82 billion.

“AWS was particularly robust,” said Cantor Fitzgerald analyst Youssef Squali. “We believe that Amazon is now starting to move away from the heavy build years for its ecommerce business just as its top line accelerates, yielding the beginnings of the much sought-after margin leverage.”

Amazon shares rose $47.24, or 9.8 percent, to close at $529.42. The stock is up more than 47 percent in the past 12 months.