Healthcare becoming as a hot an issue in the 2018 midterm elections as it was two years earlier could threaten the sector. A big risk stems from voters giving majorities to Democrats in the U.S. Senate and House of Representatives, in a rejection of President Donald Trump's Republican party.

Investors worry that shift would pressure the industry, including through a greater focus on prescription drug prices, even if Trump's grip on the presidency tempers any regulatory changes.

In 2016, similar scrutiny had plagued the healthcare sector, particularly pharmaceutical and biotechnology shares.

“If we woke up tomorrow and it was a given fact (the Democrats) were going to take over the House and the Senate, healthcare would be one of the worst-performing sectors of the market,” said Walter Todd, chief investment officer at Greenwood Capital Associates in Greenwood, South Carolina.

Momentum behind such a shift appears to be building after Democrat Doug Jones on Tuesday won a special Senate election in Alabama that will cut the Republicans' Senate edge to 51 seats against 49 Democrat seats.

Even so, healthcare shares would likely stand up better to election risk in 2018 than they did to the scrutiny of the sector in 2016.

For one, the sector is cheaper relative to the broader market following 2016's struggles. Investors also say it could benefit from a potential boost in merger activity if drugmakers and other multinational companies bring back cash held overseas under the tax overhaul bill moving through U.S. Congress.

The stocks also may be less vulnerable now to news about high drug prices and other healthcare developments, having already weathered those headlines in 2016, investors say.

And some investors are also less concerned that healthcare will be a significant topic on the campaign trail this time around, given other issues that have come to the forefront since Trump's election.

"I think there will be fears. Do they come in March? Do they come in May? I don’t know when they come, but yes there will be fears of the election," said Teresa McRoberts, a portfolio manager who focuses on healthcare at Fred Alger Management in New York.

Still, McRoberts added: "The downside in the group – it’s hard for me to see that it is going to be as much as it was in ’16.”

Healthcare shares had struggled for most of 2016, undermined by investor fears about new drug pricing rules or other regulations, especially should Democratic presidential candidate Hillary Clinton have won.

The sector <.SPXHC> declined 4.4 percent that year, making it the worst performer of all major sectors, while the overall S&P 500 <.SPX> rose 9.5 percent. Biotech and pharmaceutical shares were hit particularly hard.

Healthcare's underperformance in 2016 was its worst since 1999, and its worst in an election year since 1992.

On balance, however, midterm election years have treated healthcare stocks well.

According to Thomson Reuters data dating back to 1990, the sector's annual performance on average topped the broad S&P 500 by 2.7 percentage points. But in the seven midterm years over that time, it outperformed by 6.2 percentage points on average, with the sector outperforming in five of those years.

To be sure, certain healthcare issues, including the cost of medicine, have drawn broad attention as a populist issue, including from some Republicans like Trump himself.

But Democrats as a whole are seen as more likely to push for changes, such as the ability for the U.S. government to negotiate drug prices through the Medicare health program.

"If the 2018 elections were to see a change of leadership ... then I think the drug pricing issue would be very much back in the picture for all of the pharmaceutical and biotech companies,” said George Strietmann, portfolio manager with Cincinnati investment advisory firm Bahl & Gaynor.

Healthcare stocks rebounded by 21.5 percent so far in 2017, but that was nearly matched by the 19.3 percent rise for the S&P 500.

The sector, at 16.4 times forward earnings estimates, trades at a roughly 10 percent discount to the 18.2 price-to-earnings ratio for the S&P 500, according to Thomson Reuters Datastream.

That stands out especially when compared with the sector's nearly 18 percent premium to the S&P 500, historically, as well as its 4 percent premium in late 2015, before election-related concerns spiked.

“It’s still reasonably cheap," said Nathan Thooft, co-head of global asset allocation, Manulife Asset Management in Boston, which is overweight the healthcare sector.

Healthcare becoming a campaign issue is "definitely a risk," Thooft said. "I just don’t think it’s going to be the prominent debate of the midterm election.”

(Reporting by Lewis Krauskopf; Editing by Meredith Mazzilli)

By Lewis Krauskopf