Amazon announced a drop in second-quarter earnings Thursday and forecast lower profts in the third quarter as it enters a phase of heavy investment.

Profits slid to $197m, or 40 cents a share, in the three months ended June 30, compared with $857m or $1.78 a share in the year-ago period. The earnings fell well short of analysts’ estimates of $1.42. Shares in Jeff Bezos’ company fell 3 per cent on the news.

But “all of the change year-over-year is in the investment area”, said Chief financial officer Brian Olsavsky, pointing to investments in distribution centres, video production, the Alexa voice assistant, and server purchases for Amazon Web Services as big areas of spending.

Amazon’s acquisition of the Whole Foods groceries chain in June for $14 billion was an investment which analysts believe the e-commerce Godzilla values primarily for the distribution potential of its 400 plus retail locations, and logistics experience.

Amazon said its net sales rose 25 per cent to $38bn in the second quarter, above Wall Street estimates of $37.2bn.

One of the fastest areas of growth for the e-commerce giant was in third-party logistics, handling services for merchants who sell goods via Amazon. Revenue from these services rose 38 per cent during the quarter to hit $7bn, representing more than a sixth of Amazon’s sales. At the same time sales at Amazon Web Services, which provide cloud computing services for IT departments, saw growth slacken to 42 per cent in the most recent quarter. Margins fell to 22.3 per cent, although the unit remains the most profitable part of Amazon’s business.

Amazon shares are up nearly 40 per cent so far this year. Mr Bezos briefly surpassed Microsoft co-founder Bill Gates to be the world’s richest man earlier on Thursday.

In the past two weeks there has been news of more business areas threatened by the online giant. The first is social media: Amazon has launched an Instagram-like service called Spark; essentially a photo feed of products. The company has also expanded its food footprint with Amazon Meal Kits; essentially boxes of ingredients to prepare a full meal. And there are rumours Amazon is about to move into the world of messaging apps with a new service called Anytime.

Ahead of the quarterly earnings announcement, the Reputation Institute published a survey result suggesting the company’s reputation had suffered a downgrade amid continuing controversy over its tax affairs, and workplace conditions. In March Amazon won a $1.5 billion case against the IRS over transfer pricing.

The Reputation Institute’s RepTrak system downgraded Amazon’s overall reputation by 6 points from an excellent 80 out of 100 to a strong 74, based on a survey among the UK general public.

The RepTrak® system measures a company’s ability to deliver on stakeholder expectations on the seven key rational dimensions of reputation: products and services, innovation, workplace, governance, citizenship, leadership and performance.

According to the Institute, perceptions of Amazon’s corporate governance (incorporating fairness, ethics and transparency) were down 4 points from 65 to 61, while perceptions of Amazon’s workplace fell 14 points from last year, to 51.

However, on perceptions of products and service, Amazon has maintained an excellent rating, with 84 out of 100.