(Updates to close)
SYDNEY, Oct 21 (Reuters) - Australian shares erased morning losses and edged up 0.2 percent on Wednesday, after an attempt by bears to take the index below a key support level fizzled out.
The S&P/ASX 200 index .AXJO gained 12.72 points to 5,248.30 at the close of trade. Wednesday was the third time in the past week when bearish bets tried to push the index below 5,200.
Early in the day, all banks were down, but Australia & New Zealand Bank ANZ.AX finished up 0.6 percent and Commonwealth Bank of Australia CBA.AX 0.1 percent higher. National Australia Bank NAB.AX and Westpac Banking Corp WBC.AX were still down at the end.
Miners extended earlier gains with Fortescue Metals Group FMG.AX surging 6 percent, while Rio Tinto (L:RIO) RIO.AX and BHP Billiton (L:BLT) BHP.AX rose around 1 percent.
New Zealand's benchmark NZX 50 index .NZ50 added 0.4 percent or 22.77 points to close at 5,918.26. It was the ninth straight session of gains. During the day, the index touched a 2-1/2-month high. (Editing by Richard Borsuk)