Drug companies were playing the role of Prozac to a gloomy European market on Wednesday, defying falling markets in the wake of Donald Trump's surprise victory on expectations that pricing pressure on medicines in the U.S. will ease and as investors piled into defensive stocks.

In the U.K., generics drug maker Hikma (HKMPF) was the second best performer in early trading on the FTSE 100, up almost 7%. It was joined in the U.K. index's top 10 gainers by branded drug makers Shire (SHPG) , up 5%, and AstraZeneca (AZN) , up 2.3%. The FTSE 100 as a whole was trading down 0.43%.

In France Sanofi (SNY) was up just over 2% making it just one of three companies to buck a fall in Paris's CAC 40, which was down 1.07%. In Germany, Bayer (BAYN) and Merck (MRK) were among the handful of rising stocks on the DAX, climbing 2.7% and 1.2% respectively despite the index's fall of just under 1%. Elsewhere, Denmark's Novo Nordisk (NVO) was up 6.4%, while Switzerland's Roche (RHHBY) was up just over 4%.

Trumps election is "a positive for the (pharmaceuticals) sector, with the bulk of industry hostile legislation now off the agenda," noted BNP Paribas analysts. "The threat of further pricing pressure has receded for the most part, but expect volatility."

Among Trump's election promises was a commitment to repeal the Affordable Health Care Act, better known as Obamacare. He had also said he would allow the sourcing of drugs from overseas markets, potentially putting pressure on U.S. pricing, though the Food and Drugs Administration has typically taken a dim view of this practice at a corporate level.

A Clinton presidency would have likely weighed on drug makers' shares as she had promised to bring more purchasing under government control in order to gain rebates from drugs companies.

Pharmaceutical stocks also appear to have benefited from a flight to safety in the market, as investors cycled into so-called defensive assets as a hedge against the perceived uncertainty of Trump's presidency. Demand for drugs, which are often non-discretionary purchases, tends to be resistant to economic downturns.

Other defensive assets, including gold, up more than 2%,  and government bonds, also spiked in the wake of Trump's surprise victory.

More from Stocks

What You Need to Know About Facebook and Europe's New Privacy Rules

What You Need to Know About Facebook and Europe's New Privacy Rules

8 Bold Moves General Motors Could Make to Rev Up Its Battered Stock Price

8 Bold Moves General Motors Could Make to Rev Up Its Battered Stock Price

Is Your Investment Portfolio Prepared for Trade Wars, Inflation and More Trump?

Is Your Investment Portfolio Prepared for Trade Wars, Inflation and More Trump?

GE Is Too Opaque, Too Diversified and Too Poorly Managed: Doug Kass Insider

GE Is Too Opaque, Too Diversified and Too Poorly Managed: Doug Kass Insider

Dow Falls Over 200 Points as Apple's Slump Offsets Gains in General Electric

Dow Falls Over 200 Points as Apple's Slump Offsets Gains in General Electric