TORONTO, June 29 (Reuters) - Toronto’s main stock index closed at its highest level in almost three weeks on Wednesday after Greece’s parliament approved the first of two austerity measures to prevent the country from going bankrupt.

Though the decision was widely anticipated, world stocks and commodities rallied for the third straight day as the Greek government won the deeply unpopular fight for a five-year plan of spending cuts and tax hikes. [MKTS/GLOB]

The index’s three most influential sectors were all stronger, with materials up 1.4 percent, energy up 1.2 percent, and financials 0.1 percent higher.

The Toronto Stock Exchange’s S&P/TSX composite index .GSPTSE closed up 83.96 points, or 0.64 percent, at 13,188.94, after a softer start. It was the highest close since June 9.

“The yes vote just removes this huge cloud of uncertainty in the market,” said Serge Pepin, head of investments at BMO Investments.

“You heard this big sigh of relief out there,” he added, noting however that the market’s initial response was to buy on the rumor and sell on the fact. Canadian stocks have rallied all week as some investors, anticipating the Greek decision, began pricing it in.

Pepin cautioned that Greece is not out of trouble just yet. “Now Greece really has to come to the plate and prove it can put this five-year austerity plan in place and adhere to it,” he said.

Looking ahead to Thursday, the solid margin in the austerity vote suggests the Greek government should now be able to push through laws on specific budget measures, clearing the last obstacle to obtaining 12 billion euros ($17.3 billion) of emergency loans.

“We have three hurdles that are bothering us this summer,” said Barry Schwartz, a portfolio manager at Baskin Financial Services.

“The first one is we’ve got a Greek austerity plan out of the way, the other two are what are we going to do to get the economy rocking and rolling again, and can the Republicans and Democrats get to an agreement on the debt ceiling.”

Riskier assets also got a boost from data showing a rebound in Japanese industrial production last night and mildly encouraging report on U.S. pending home sales shortly after the market open.

In individual company news, TMX Group (X.TO) ended up 1.5 percent at C$44.20 after the London and Toronto stock exchanges canceled plans to combine forces. That pushed a consortium of Canadian banks and pension funds into the driver’s seat in the takeover battle for the Toronto Stock Exchange. [ID:nN1E75S1EI]