Amazon published its second quarter financials late on Thursday, and the unexpected results have moved the company above Walmart to become the largest US retailer. The digital store is now worth more than $250 billion, while its brick-and-mortar competitor is valued at $233.5 billion.

Amazon reported that Amazon Web Services generated $1.8 billion in sales for Q2, up about 80 percent from the $1 billion it brought in a year earlier. This increase helped the company achieve a profit of $92 million, a turnaround from the $126 million loss it made during the same period last year. Revenue grew by 20 percent overall, to $23.16 billion.

Source: Quartz

Q2 marks the second quarter in which Amazon has released specific results for its cloud unit, Amazon Web Services, which provides cloud computing and storage space for businesses to save data and run systems, eradicating the need to build data centers and servers costing hundreds of millions.

"It was a very strong quarter for AWS," said Brian Olsavsky, Amazon chief financial officer, on a call with investors. He argued that AWS is actually performing even better than the figures indicate; he noted that in the last year, usage has outgrown sales, and it was the company's price cuts which obscured this fact. The company is planning for even more Amazon Web Services growth, as it is prepares to expand the business into India next year.

Sales in the United States, Amazon's biggest market, rose 25.5 percent to $13.8 billion on strong demand for electronics and general merchandise. The company said the popularity of its Prime service has helped drive growth.

Amazon held its first Prime Day on July 15 with an exclusive sale targeted at subscribers to the Amazon Prime loyalty program. Although many found the deals on offer disappointing, more new members tried Prime worldwide than any single day in Amazon's history.