The Seattle-based company also offered on Thursday a sales outlook for the current quarter that beat analysts' projections.
Still, it shares fell 3.0 per cent in after-market trading.
The company also reported 17.5 per cent growth for its prominent cloud computing arm Amazon Web Services.
The results come even as uncertainty about US President Donald Trump's tariffs have challenged companies and consumers. But Amazon and other large retailers have tried to beat the clock by bringing in foreign goods before Trump's tariffs took effect. Amazon, like many other big retailers, has the clout to negotiate prices with its suppliers.
Meanwhile, Amazon is one of the biggest players in the race around generative artificial intelligence.
Like other tech companies, it has increased investments in the technology and is spending billions to expand data centres that power AI and cloud computing. The company is also investing in its own computer chips and those developed by Nvidia. It has also expanded its own AI models and integrated generative AI into other parts of its business.
In March Amazon began testing AI-aided dubbing for select movies and shows offered on its Prime streaming service. A month earlier, the company rolled out a generative-AI infused Alexa.
Company CEO Andy Jassy anticipates generative AI will also allow Amazon to reduce its corporate workforce in the next few years.
Amazon earned $US18.16 billion ($A28.21 billion), or $US1.68 ($A2.61) per share, for the quarter ended June 30. That's up from $US13.49 billion ($A20.96 billion), or $US1.26 ($A1.96) per share, in the year-ago period.
Revenue rose to $US167.7 billion ($A260.5 billion) from $US147.9 billion ($A229.8 billion) a year ago.
The company's sales were helped by Amazon's Prime event amid tariff-related price worries. For the first time, Amazon held Prime Day over four days instead of two.
Analysts expected earnings per share of $US1.33 ($A2.07) on sales of $US162.19 billion ($A251.97 billion) for the quarter, according to FactSet.
The company said it expects sales for the current quarter of between $US174 billion ($A270 billion) and $US179.5 billion ($A278.9 billion). Analysts expected $US173.27 billion ($A269.18 billion) for the current quarter, according to FactSet.