Australian shares closed higher on Tuesday, supported by gains in major mining stocks and positive momentum from the US market ahead of a key inflation report due Wednesday. The S&P/ASX 200 rose 40.2 points, or 0.46 percent, to 8,850.1, while the broader All Ordinaries index added 42.2 points, or 0.47 percent, to 8,968.8.

The market showed early weakness with a decline of up to 0.4 percent in morning trade before rebounding strongly in the afternoon. The Australian dollar also firmed against the US dollar, reaching 70.22 US cents late in the session.

Among the 11 sectors, only five recorded gains, led by the materials sector which climbed 2.78 percent, contributing significantly to the benchmark's advance. Mining giants BHP and Rio Tinto were notable movers, with BHP rising 4.26 percent to $57.99 and Rio Tinto climbing 2.53 percent to $150.32. The gains were partly attributed to a steady copper price.

Technology stocks also provided support to the market. Megaport surged 9.6 percent to $17.58, NextDC gained 3.79 percent to $5.75, and Codan increased 2.61 percent to $57.43.

In contrast, consumer discretionary shares fell, weighed down by investor caution ahead of the inflation data release on Wednesday, which is expected to influence decisions on interest rates. Wesfarmers slipped 0.25 percent to $78.83, JB Hi-Fi dropped 1.4 percent to $72.32, and Eagers Automotive declined 4.69 percent to $19.09. The inflation figures could determine whether the Reserve Bank of Australia raises interest rates for a fifth time this year, coinciding with Melbourne Cup day.

Investor sentiment overseas was buoyed by a strong performance on Wall Street, highlighted by the much-anticipated initial public offering (IPO) of artificial intelligence firm Anthropic. Josh Gilbert, lead analyst at eToro, noted the company revealed ambitious plans for sustained growth and significant future computing power commitments, despite reporting an $80.7 billion first-half loss. Gilbert pointed out the challenge Anthropic faces in balancing rapid growth with steep costs but acknowledged the remarkable increase in customer spending on its AI platform Claude.

In corporate news, casino operator Star Entertainment surged 13.04 percent to 13 cents following a stronger-than-expected quarterly earnings report. The company posted earnings before interest, taxes, depreciation, and amortisation (EBITDA) of $12 million, reversing a $13 million loss from the previous comparable period.

Shares in biotechnology company CSL rose 0.84 percent to $196.87 despite the firm reporting a 1 percent decline in revenues to $15.8 billion and a net loss after tax of $2.6 billion. Energy company Woodside gained 0.27 percent to $33.18 after announcing plans to sell its 33.4 percent stake in the Greater Sunrise gas project for up to $200 million.

Gold-related stocks also enjoyed positive momentum, with Newmont, Genesis Minerals, and Northern Star Resources all finishing higher amid a rising gold price.