A surging health-care sector helped Toronto’s main stock index move higher into record territory Tuesday, despite a broad-based decline that included energy and mining stocks.

The commodity-heavy S&P/TSX composite index advanced 39.59 points to 16,131.79, with shares of Valeant Pharmaceuticals International Inc. up more than 17% on the day.

The embattled Quebec drugmaker’s stock closed at $18.09 on Tuesday after it reported a profit of $1.3 billion in its latest quarter and total debt reduction of $6 billion since the end of the first quarter of 2016. The financial results came out a day after Valeant announced a deal to sell its female sexual dysfunction drug back to the company’s former owners in exchange for a royalty on sales.

“Valeant is a name that has gained some footing recently but obviously nowhere near where it once was trading quite a while ago,” said Allan Small, a senior investment adviser at Holliswealth. “They are basically selling off assets to pay down debt and get their turnaround story and their company back on track.”

Valeant still faces a string of lawsuits, including one from its former CEO and U.S. investigations over its drug pricing practices after questions about the company’s business model first emerged two years ago. The scrutiny caused its stock to plunge from more than $300 per share.

Several Canadian marijuana companies also propelled health care higher, with shares of Aurora Cannabis Inc., Canopy Growth Corp. and Aphria Inc. all swinging to the upside on Tuesday.

South of the border, U.S. stock indexes were mixed as smaller companies and banks took their worst losses in a few months. With stock indexes near record highs, investors moved some money into big-dividend stocks like real estate companies.

The Dow Jones industrial average added 8.81 points to 23,557.23, marking its fourth consecutive day of record highs.

Meanwhile, the S&P 500 index was down 0.49 of a point to 2,590.64 and the Nasdaq composite index dropped 18.66 points to 6,767.78.

In currency markets, the Canadian dollar was trading at an average price of US78.22¢, down 0.24 of a U.S. cent.

On the commodities front, the December crude contract fell US15¢ to US$57.20 per barrel and the December natural gas contract was up US2¢ at US$3.15 per mmBTU.

The December gold contract was down $5.80 to US$1,275.80 an ounce and the December copper contract gave back US7¢ to US$3.09 a pound.