Republicans will hold on to control of the House, NBC News projects, overcoming a top-of-the-ticket drag from Donald Trump that had Democrats expressing cautious optimism at their chances of taking back the chamber.

Republicans are still expected to lose anywhere from five to 20 seats on Tuesday due in large part to the controversial GOP nominee, who has created unexpected headaches for some typically safe members.

In particular, the release of the controversial 2005 video in which Trump bragged about groping women in lewd terms, which caused Republicans to abandon their nominee in droves, fueled Democratic optimism.

But with a 247-188 majority, 30 or more House Republicans would have to lose to deliver control to Democrats.

Indeed, as the race tightened at the top of the ticket over the past few weeks, in part due to the new revelations in the FBI investigation into Hillary Clinton’s email use, Democratic hopes for taking back the House waned. House Minority Leader Nancy Pelosi told reporters Tuesday she felt FBI Director James Comey’s initial letter announcing potential new evidence in the investigation — which the FBI announced this weekend was ultimately inconsequential — took the House off the map.

“I would say that when the director of the FBI, Mr. Comey, released that letter two Fridays ago, he became the leading Republican political operative in the country,” she said.

“But we can see very clearly that, and I think most people would've agreed, the success, the opportunity to win the House was predicated on a big victory for Mrs. Clinton. When her numbers narrowed, so did that prospect,” Pelosi added.