At the 4.15pm (AEST) close, the benchmark S&P/ASX200 index was up 71.1 points, or 1.81 per cent, at 3995.6, after trading as high at 4022.3.
The broader All Ordinaries gained 70.3 points, or 1.79 per cent, to 3,987.8 points.
IG Markets research analyst Ben Potter said the share market rose after investor sentiment was boosted by Wall Street's strong performance.
"However, after three strong sessions, traders are beginning to take some profits off the table,'' he said.
Mr Potter said he expected downbeat corporate news from the US to pull back the market a little.
Mr Potter said data showing China's economy had expanded at an increased rate was largely factored into the markets.
China's economy expanded by 7.9 per cent from a year earlier, official data showed today.
Energy stocks were higher.
Woodside rose 51 cents to $41.40, Santos increased 35 cents to $13.92, and Oil Search grew 13 cents to $5.41.
Banks were also in positive territory.
Commonwealth Bank gained 59 cents to $39.41, ANZ lifted 15 cents to $16.65, and Westpac rose 22 cents to $20.18.
NAB was up 60 cents at $23.95. It announced that subsidiary Bank of NZ had lost a court case that could cost it around $530 million in tax and interest.
Former St George Bank chief executive Paul Fegan has been appointed to the board of AMP. AMP lifted 11 cents, or 2.29 per cent, to $4.91.
The major miners were stronger.
Rio Tinto shares gained 4.63 per cent to $52.40, while rival BHP Billiton lifted 1.78 per cent to $34.91.
Among the gold miners, Newmont was up 16 cents at $5.04, Newcrest rose 74 cents to $31.00 and Lihir Gold added 3 cents to $2.92.
Sino Gold, which announced today a 51 per cent increase in gold production in the June quarter, gained 23 cents to $5.23.
The spot price of gold in Sydney was $US937.00 per fine ounce at 4.26pm, up $US8.55 on yesterday's close of $US928.45.
On the Sydney Futures Exchange, the September share price index contract was 83 points higher at 3971 on 29,598 contracts.
Resources, banks push market higher