The Toronto Stock Exchange finished solidly higher on Friday as strong commodity prices helped the energy sector to a last-minute rally, shrugging off concerns over Alberta’s new oil and gas royalty structure.

The S&P/TSX composite index gained 171.49 points, or 1.21%, to finish at. 14,296.43.

For the week, the benchmark index posted a gain of 294.77 points or 2.1%.

All 10 of the TSX main groups advanced Friday.

The engery sector ended up 0.2% on Friday, the day after Alberta Premier Ed Stelmach said the province will boost oil and gas royalties but backed off some of the more contentious recommendations of an advisory panel on royalties.

The December crude oil contract on the New York Mercantile Exchange rose US$1.40 cents to US$91.86 on tensions in the Middle East and renewed concerns about supply.

Petro-Canada was up 9¢, or 0.2%, at $53.09. Husky Energy gained 80¢, or 1.8%, to $43.60.

The financials group broke a three-day decline to climb 1.9%. Bank of Nova Scotia shares added $1.55, or 3%, to $51.60, and Royal Bank of Canada advanced $1.27, or 2.4%, to $53.88.

Materials gained 1.8%, while the gold subgroup was up 2.4%.

The junior S&P/TSX Venture composite index climbed 39.44 points, or 1.29%, to 3,091.62.

The Canadian dollar traded as high as US104.10¢ Friday — its highest since May 1974 — before closing the session at US103.93¢.

In New York, stocks rallied on Friday after Microsoft’s upbeat outlook and a profit forecast from U.S. mortgage lender Countrywide Financial buoyed the struggling financial sector.

The Dow Jones industrial average was up 134.78 points, or 0.99%, to end at 13,806.70. The S&P 500 was up 20.88 points, or 1.38%, at 1,535.28. The Nasdaq composite index was up 53.33 points, or 1.94%, at 2,804.19.

For the week, the Dow rose 2.11%, the S&P 500 added 2.31% and the Nasdaq gained 2.90%.