(Updates to close)
April 20 (Reuters) - Australian shares closed slightly higher on Thursday, as bargain hunters bought stocks that were battered in the last few sessions.
The S&P/ASX 200 index gained 0.3 percent or 17.39 points to end the session at 5821.40.
Banks and telecom sector led the gains on the benchmark while resources stocks continued to be under pressure from weaker commodity prices.
"I think there is bargain hunting in the market today, particularly in the telco sector," added Bill Keenan, general manager of direct equities research at broker Lonsec.
The telecom index posted second straight session of gains after four days of falls. Telstra Corp, Australia's largest telecoms company, ended 2.9 percent higher.
The 'big four' banks ended higher. Australia and New Zealand Banking Group closed up 1.2 percent.
Meantime, energy stocks finished lower, with oil majors Woodside Petroleum and Santos Ltd ending in the red.
Big miners Rio Tinto and Fortescue Metals trimmed early gains to end the session lower.
New Zealand's benchmark S&P/NZX 50 index ended 0.42 percent or 30.46 points lower at 7188.05, its lowest close in three weeks.
Consumer and industrial stocks were the worst performers. Top loser a2 Milk Company Ltd ended 2.5 percent lower.
First quarter data showed New Zealand's inflation at its highest in five years. (Reporting by Anusha Ravindranath in Bengaluru; Editing by Simon Cameron-Moore; Additional reporting by Hanna Paul)