After drifting lower for much of the week, the sharemarket finished on a high after a pledge from European officials to keep the region's common currency together.
A promise from the president of the European Central Bank, Mario Draghi, to do "whatever it takes" to hold the common currency together sparked a rally on global markets.
Local shares followed global markets higher, surging more than 1.5 per cent. For the week, the benchmark S&P/ASX200 index gained 10.68 points, or 0.25 per cent, to 4209.8 points.
Resource and financial stocks drove the market higher, with BHP Billiton up 45? at $31.42, and Rio Tinto jumping $1.49 to $52.
Among the banks, Commonwealth Bank was up 77? at $56.18, ANZ rose 42? to $23.08, National Australia Bank rose 41? to $24.25 and Westpac rose 39? to $23.
Analysts admitted they were caught off guard yesterday by comments from Dr Draghi that the ECB would be willing to restart bond purchases as Spanish government bond yields hit euro-era highs and worries mounted that Greece could again be forced to restructure its debt.
The reaction from shareholders helped push the sharemarket yesterday to its second-biggest daily rise in seven months.
The week's trading could be roughly divided into two halves.
Several big companies such as BHP Billiton and Rio Tinto had indicated their profits would be much lower than expected for the full year. There were reports during the week that earnings forecasts had been downgraded in the past six months by an average of 5 per cent. This led to stocks losing ground as investors prepared for the start of the profit reporting season that gets under way next month.
New data showed inflation slid to a 13-year low in the June quarter, clearing the path for the Reserve Bank to cut the cash rate again if conditions in Europe deteriorate further.
On Thursday, a slew of banks, such as UBS, JPMorgan, HSBC and CBA walked away from earlier calls that the rate cut would come next month.
Business conditions for farmers deteriorated in the June quarter, because of worsening trading conditions, and reduced profitability and employment.
For the week, Caltex shares lost 48? to $14.17, after it committed to shutting its Sydney plant. It refused to guarantee the long-term future of 660 workers at its Brisbane oil refinery.
Billabong shares gained 17? at $1.35 after the troubled surfwear retailer appeared to be going cold on the $695 million takeover offer from the US private equity group TPG.
Woolworths rose $1.08 to $28.70 after overcoming tough trading conditions to lift its sales by 4.7 per cent to $56.7 billion for 2011-12.
Qantas shares rose 2.5? to $1.09 after the national carrier confirmed it was in talks with several airlines about potential alliances, including Dubai's Emirates.
Leighton shares were up 42? at $16.64 after its mining services arm, Thiess, won a $2.3 billion contract to extend operations at the Lake Vermont coalmine in Queensland's Bowen Basin.