The sharemarket turned positive on Wednesday after two days of losses, with investors buoyed by strong overseas leads.
The S&P/ASX 200 Index cracked the 5000-point mark for only the third time in 20 days of trading, closing up 53.8 points, or 1.09 per cent, at 5004.6. The broader All Ordinaries was up 49.5 points, or 1 per cent, at 4993.6.
The market was following a strong session on Wall Street, with stocks up more than 1 per cent overnight, a day after their worst decline since November, as gold prices rebounded.
Benign March inflation data, which reinforced expectations that the US Federal Reserve would keep its stimulus plan in place, further bolstered sentiment.
Locally, consumer staples led the gains, including supermarket owner Woolworths, which rose 84¢, or 2.4 per cent, to $35.60, while rival Wesfarmers gained $1.21, or 3 per cent, to $41.89.
Telstra also had a good day out, gaining 13¢, or 2.7 per cent, to $4.82. CommSec analyst Steve Daghlian said the stock was up 10.3 per cent in 2013 and trading at a five-year high.
But the news was not all good, with traders still shunning mining and energy stocks, with the steep commodity price drops still fresh in people's minds, according to CMC Markets senior trader Tim Waterer.
Mining stocks were down for the fifth day in a row, as was the biggest resources stock, BHP Billiton, which lost 9¢ to $32.06. That came after the company maintained its production guidance for 2012-13 in its latest quarterly report despite weather-related disruptions.
Australia's largest goldminer, Newcrest, made a modest rebound, rising 10¢ to $17.10 after heavy falls this week due to record plunges in the gold price.
The big banks posted strong gains, with ANZ 23¢ higher at $29.09, Commonwealth Bank up $1.15 to $69.29, National Australia Bank improving 41¢ to $32.24 and Westpac 32¢ richer at $31.82.
On the bond market, futures prices moved lower overnight on Tuesday as the gold selloff stalled.
UBS interest rate strategist Matthew Johnson said futures prices traded in a narrow range during Wednesday's session. He said concern about the outlook for commodity prices prevented bonds from selling off further.
"There is definitely concern the recent fall in gold and copper may be the start of a broader move in commodity prices," he said.