(Reuters) - Johnson & Johnson posted better-than-expected third-quarter earnings, raising its full-year forecast due to growth from new cancer drugs and high-margin treatments picked up in its $30 billion acquisition of Actelion earlier this year.

A Johnson & Johnson building is shown in Irvine, California, U.S., January 24, 2017. REUTERS/Mike Blake

Shares of J&J, part of the Dow Jones Industrial Average, rose 3.4 percent to $140.79 on Tuesday.

The shares have traded at or near record levels for much of the year. Guggenheim Securities analyst Tony Butler said the stock has historically done well when its high-margin pharmaceuticals business is the main driver of growth, rather than its consumer segment.

Sales at J&J’s pharmaceuticals segment rose 15.4 percent to $9.7 billion in the third quarter. Around half of that growth came from the Actelion deal.

Higher demand for J&J’s blood cancer drugs, Darzalex and Imbruvica, and Actelion’s rare diseases treatments are expected to boost earnings going forward.

The two cancer drugs should continue to capture market share, Guggenheim Securities’ Butler said.

“The oncology business is doing exceptionally well,” he said. “It’s really hard to figure out where that stops for both Darzalex and Imbruvica.”

Still, sales of J&J’s diabetes drug, Invokana, slipped around 10 percent from the second quarter. The company this year was required to add new warnings about the risk of foot and leg amputations and also has had to contend with competition from Eli Lilly and Co’s Jardiance.

Its rheumatoid arthritis drug, Remicade, also had weaker sales in the quarter.

J&J said adjusted earnings, excluding one-time items, rose 13 percent to $1.90 per share. Analysts on average were expecting an adjusted profit of $1.80 per share , according to Thomson Reuters I/B/E/S.

Sales at J&J’s consumer products segment, which makes Band-Aids, Neutrogena beauty products and Tylenol, rose 2.9 percent to $3.4 billion.

The company’s net earnings fell to $3.76 billion, or $1.37 per share, in the quarter from $4.27 billion, or $1.53 per share, a year earlier. The company said it was hurt by amortization and deal-related expenses.

J&J raised its 2017 profit forecast to $7.25 to $7.30 per share, from its previous forecast of $7.12 to $7.22 per share. It now expects revenue of $76.1 billion to $76.5 billion for the year.

Johnson & Johnson has six drug manufacturing facilities on Puerto Rico, which was hit by Hurricane Maria last month. It said that while they are all running again, it cannot rule out intermittent shortages of some of its drugs.

Also on Tuesday, the company won the reversal of a $72 million verdict in favor of the family of a woman whose death from ovarian cancer they claimed stemmed from her use of the company’s talc-based products like Johnson’s Baby Powder.