* Aussie shares end eight sessions of consecutive losses
* Banks and energy account for most of the gains
* CSL drags as shares trade ex-div
* NZ rises 2 pct on a2 Milk rally
(Updates to close)
Sept 11 (Reuters) - Australian shares advanced on Tuesday, putting an end to eight consecutive days of losses as investors bought into beaten-down banks and as energy stocks firmed on higher oil prices.
The S&P/ASX 200 index .AXJO rose 0.6 percent or 38 points to 6,179.7 at the close, after giving up 2.1 points on Monday.
Banks supported the mild recovery on the day, having lost about 3.5 percent in the past eight sessions versus broad market declines of about 3.4 percent in the same period.
Index heavyweight Commonwealth Bank of Australia CBA.AX firmed 1.6 percent and was the biggest boost to the benchmark, while investment bank Macquarie Group Ltd MQG.AX rose 1.8 percent.
Earlier in the day, Macquarie said it expects group's fiscal year 2019 result to be broadly in line with fiscal 2018. jump in oil prices on looming U.S. sanctions against Iran boosted demand for local energy stocks .AXEJ which jumped 2.1 percent and supported the broader market. O/R
New South Wales-based Whitehaven Coal Ltd WHC.AX was among the top gainers as it jumped 3.7 percent to a near four-week high, while Origin Energy Ltd ORG.AX rose 3.2 percent to its highest since August 29.
Elsewhere, healthcare stocks .AXHJ fell, capping the gains on the benchmark.
Shares of Drugmaker CSL Ltd CSL.AX , which were trading ex-dividend, fell 0.7 percent to a four-week low, while Australian shares of California-based Resmed RMD.AX slipped 0.8 percent.
Medical device maker Fisher & Paykel Healthcare FPH.NZ said it had filed a patent infringement complaint against Resmed, alleging it infringed five of its patents related to sleep apnea devices. New Zealand, the benchmark S&P/NZX 50 index .NZ50 rose about 2 percent or 176.940 points to finish the session at 9.225.57.
Dairy firm a2 Milk Company Ltd ATM.NZ accounted for most of the gains as it surged 4.9 percent, while teleco Spark New Zealand Ltd SPK.NZ firmed 3.6 percent to its highest in more than twelve years.