US stocks finished higher Wednesday following a volatile session, with strong gains by energy shares offsetting the hit to the pharmaceutical sector following criticism by President-elect Donald Trump.
Pharma shares quickly nosedived after Trump accused the industry of "getting away with murder" in offshoring production capacity and overcharging for drugs. He said he would push to change the bidding procedures for drugs.
Pfizer fell 1.9 percent, Celgene 2.3 percent and Mylan 4.3 percent, while Bristol-Myers fell 5.3 percent.
But those losses were countered by solid gains by petroleum-linked stocks after oil prices advanced. Apple and some other technology shares also pushed higher.
The market is "bullish and hopeful that the new administration and Congress can deliver these new plans right away," said Jack Ablin, chief investment officer at BMO Private Bank.
The Dow Jones Industrial Average rose 0.5 percent to end at 19,954.28.
The broad-based S&P 500 advanced 0.3 percent to 2,275.32, while the tech-rich Nasdaq Composite Index gained 0.2 percent to 5,563.65, another record.
Merck bucked the tide among pharma companies, jumping 2.9 percent on news the Food and Drug Administration accepted for review the drug giant's treatment for metastatic lung cancer.
United Continental advanced 2.0 percent after it released December performance estimates that bested expectations due to improved booking.
American Airlines rose 0.3 percent after it said improved results in December had boosted its fourth-quarter estimate for revenue per passenger mile travelled.
Ford shed 1.4 percent after it confirmed that it expects about $10.2 billion in pre-tax 2016 profits. It said it expects "continued strong performance in 2017."