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) - Get Report , up 5%, and AstraZeneca (AZN) - Get Report , up 2.3%. The FTSE 100 as a whole was trading down 0.43%.

In France Sanofi (SNY) - Get Report 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) - Get Report 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) - Get Report 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.