After an up-and-down day Wednesday, U.S. stock indexes closed with modest gains led by energy companies that rose as crude oil prices headed higher.

ON WALL STREET: At the close, the Dow Jones industrial average was up 98.8 points, about 0.5 percent, at 19,954.3. The Standard & Poor’s 500 index gained 6.4 points, about 0.3 percent, to 2,275.3. The Nasdaq composite was up 11.8 points, about 0.2 percent, to 5,563.7.

advertisement | advertise on newsday

OIL PRICES: As markets closed, benchmark U.S. crude was up $1.53 at $52.35 a barrel in electronic trading on the New York Mercantile Exchange. In London on the Intercontinental Exchange Europe, Brent crude, which is used to price oil sold internationally, gained $1.60 to $55.24 a barrel.

TRUMP FACTOR: During a news conference Wednesday morning, President-elect Donald Trump said the government has to create new bidding procedures for the pharmaceutical drug industry “because they’re getting away with murder.” The remarks sent health care stocks and the indexes lower. Several pharmaceutical companies slumped, with Endo International falling 10.3 percent, the biggest decliner in the S&P 500. It recovered in late afternoon and closed down only $1.30 at $14.01 a share. Likewise Perrigo closed down $5.77, about 7 percent, at $77.88. It lost around 8.5 percent right after Trump spoke. Mallinckrodt closed down $3.31, about 6 percent at $50.44. It had tumbled about 8 percent.