* Trump says "all is well" after Iran missile attack
* Gold index hits near 3-month closing high
* Energy stocks gain for 5 straight sessions (Updates to close)
By Niyati Shetty
Jan 8 (Reuters) - Australian shares trimmed losses on Wednesday after U.S. President Donald Trump's comment on the Middle East tensions reassured investors rattled by Iranian missile attacks on U.S.-led forces in Iraq earlier in the day.
The S&P/ASX 200 index .AXJO closed down 0.1%, or 8.8 points, at 6,817.60, after declining as much as 1.1% in early trade. The benchmark gained 1.4% in the previous session.
Tehran's missile attack on U.S. forces, which was in retaliation to the killing of Iranian commander Qassem Soleimani last week, stoked concerns about a broader regional conflict.
Lifting market sentiment, Trump in a tweet late on Tuesday said "all is well!", and added that an assessment of casualties and damage from the strikes was under way and that he would make a statement on Wednesday morning. pulled back from the losses as the rhetoric was not as harsh as investors were expecting, said James Tao, market analyst at CommSec.
"The strikes set the expectations that there could be a harsh rebuke from the United States."
Export-reliant healthcare stocks .AXHJ reversed course to end up 0.5%, with CSL Ltd CSL.AX and Cochlear Ltd COH.AX adding 0.9% each.
Safe-haven gold stocks .AXGD surged 3.2% to a near three-month closing high, with heavyweight Newcrest Mining NCM.AX adding 4%.
Northern Star Resources NST.AX gained 2.5%, while Evolution Mining EVN.AX rose 2.1%.
The energy sector .AXEJ extended gains for a fifth straight session as oil prices surged on concerns over crude supply disruptions in the Middle East. O/R
Woodside Petroleum WPL.AX tacked on 1.4%, while smaller peer Santos STO.AX climbed 1.1%.
Risk-averse sentiment hurt financials .AXFJ the most, with all of the "Big Four" heavyweight lenders falling. Top lender Commonwealth Bank of Australia CBA.AX shed 0.4%, while Westpac Banking Corp WBC.AX lost 0.3%.
Across the Tasman Sea, New Zealand's benchmark S&P/NZX 50 index .NZ50 fell 0.6%, or 72.88 points, to 11,556.98.
Retirement homes operator Summerset Group SUM.NZ fell 4.3% and was the top loser on the bourse, while Restaurant Brands New Zealand RBD.NZ slipped 2.7%.