WASHINGTON –– Conor Lamb’s surprising win in a Pennsylvania special election for a House seat may be a sign that the key to success for Democrats running in red districts is distancing themselves from the national party.

Lamb won against Republican Rick Saccone in a Tuesday election for the state’s 18th congressional district –– where Trump had won by nearly 20 percent.

Lamb was successful because he was a moderate candidate who did not always follow the more liberal agendas of the national leadership, said Christopher Donnelly, an assistant teaching professor at Drexel University in Philadelphia.

For example, while House Minority Leader Nancy Pelosi supports a proposed ban on assault weapons, Lamb said new gun control laws are not the answer to stop mass shootings.

“If you run candidates that take all the the same positions of the Democratic leadership in Congress and you run them at red districts that’s not a winning strategy,” Donnelly said. “Right now they may need to sacrifice some of this ideological purity in order to win these red districts.”

For Democrats running in red districts, it helps to identify more as an individual than a member of the party, Marshall University Professor George Davis said. Lamb did well in the special election because he distanced himself from his party, the political science professor said.

Lamb repeatedly said that he does not support Nancy Pelosi’s leadership. Yet Pelosi said Lamb disavowing her had little to do with his win.

“I don’t think he ran against me the entire time. I think he ran on his positive agenda,” she said. “It was a very issues oriented campaign.”

Despite Lamb’s attempts to distance himself from the party, Pelosi said the “D” next to his name was significant. She said she believes there will be a Democratic wave in the November midterm elections.

Pelosi also said she is confident about her role as “master legislator,” despite the criticism she has received from Lamb and other Democrats.

“I have a strong following in the country, and I don’t think that the Koch Brothers should decide who the leader of the Democratic Party is in the House.”

Whether or not they distances themselves from the part, those running in red states with white, blue-collar voters, should focus on labor, Davis said. Lamb was able to win over white working-class voters –– who had largely voted for Trump –– by supporting labor’s issues. While campaigning, he held rallies with union workers and pledged to support a bill that would ensure pensions for miners.