In a victory for working people that seemed impossible just weeks ago, Pennsylvania union members tipped a deep red congressional district blue in a special election Tuesday.

Conor Lamb speaks about workers' rights at a labor rally in Pittsburgh days before winning a U.S. House seat in a deep-red congressional district. Impressed by his message, union members turned out in force to campaign and vote for him.

IBEW and other union members in Pennsylvania’s conservative 18th district forcefully campaigned for Conor Lamb, giving the unabashed pro-union Democrat a narrow win in a House district that Donald Trump won by 20 points in 2016.

"Side by side with us at each step of the way were the men and women in organized labor," Lamb said in his victory speech. "Organized labor built Western Pennsylvania...Tonight, they have reasserted their right to have a major part in our future."

Through mailers, social media and other outreach, Pittsburgh locals 5, 29, 126, 1024 and 1919 helped turn out voters and inspire members to take part in phone banks, labor walks and rallies for Lamb.

While candidates routinely court labor, Lamb’s embrace of unions and concern for workers feels genuine, said Kris Anderson, the IBEW’s political coordinator in Pennsylvania.

“I was so excited to hear him profess his gratitude toward labor in his speech,” Anderson said. A lot of times we get left at the altar when it comes to the thank-yous.”

Local 29 Business Manager Kenn Bradley also was pleased. “It’s very important for him not to forget labor,” he said. “We were a big reason why he got voted in, and now we have to hold his feet to the fire and make sure he follows through on his promises, which I think he will. I believe he’s a man of his word.”

As vital a role as each union and its members played in electing Lamb, Anderson said labor community teamwork made all the difference. “Major credit goes to our ability to work in conjunction with each other and develop a unified message,” he said.

The 18th district seat opened up with the resignation of Republican Tim Murphy last fall.Lamb’s opponent was Rick Saccone, a brazenly anti-union state representative who sold himself to voters as “Trump before Trump.”

Lamb has just over seven months to prove his commitment to workers before voters go to the polls again in November. Under a new congressional district map that the Pennsylvania Supreme Court ordered in January, he’ll be running for re-election in the 17th district.

The court ruled that the map in place since 2011 constituted illegal partisan gerrymandering by the GOP.The boundaries were so tilted in the party’s favor that Democrats didn’t even field a candidate in the 18th the past two elections.

Ultimately, Lamb won by fewer than 700 votes, roughly one vote per precinct. But even a narrow victory in deep “Trump country” was a steep uphill battle, with polls showing Saccone ahead as recently as early March. Political observers say the outcome should send a strong message to Republicans, while warning Democrats not to take anything for granted.

AFL-CIO President Rich Trumka called it a “wake-up call for every single politician”

Campaigning for Conor Lamb, right, in Pennsylvania's 18th congressional district, Local 126 business agent Hank Boldyzar, left, engaged union members and organized a meet-and-greet for the candidate.

“Earning the support of working people is a high bar that must be cleared with meaningful words and actions—not blind deference to party operatives or corporate interests,” Trumka said. “Working people are ready to move heaven and earth to help a genuine ally. But we won’t waste a dime or a door knock on fair weather friends.”

Union members were drawn to Lamb’s blend of social conservatism with progressive stands on workers’ rights and the well-being of working people. Mineworkers President Cecil Roberts summed it up colorfully at a get-out-the-vote rally.

“Let me try to explain what kind of folks we are and what kind of Democrat Conor is,” Roberts said in the fiery tones of a preacher. “He’s a God-fearing, union-supporting, gun-owning, job-protecting, pension-defending, Social Security-believing, health care-greeting and sending-drug-dealers-to-jail Democrat!”

In other words, Lamb was uniquely well suited for his working-family district, a lesson for both parties.

“This is just the start of it – if we can keep our members energized and if we put more labor candidates on the ballot,” said Hank Boldyzar, an elected commissioner in nearby Rostraver Township and business agent for statewide Local 126, headquartered in Philadelphia. It has about 200 members in the Pittsburgh area.

Active in his county’s labor council, Boldyzar persuaded the organization to host a meet-and-greet for Lamb that drew about 150 union members and other voters in a region many candidates largely ignore.

“I think he talked to everybody in the room that night,” he said. “I had lots of people come up and say they were undecided until they met him.”

Supporters say Lamb raised grassroots campaigning to an art form between his personal outreach and the activism he inspired. On MSNBC’s “Morning Joe,” the day after the election, he said it’s what today’s environment demands.

“No offense to all my friends who make their living on T.V. – campaigning in real life in small rooms, door-to-door, person-to-person, it works and I learned a lot doing it and I think that helped out campaign an awful lot. And I would advise anybody, no matter where they are, to do that.”

Boldyzar also approached the campaign one voter at a time. Often recognized as a township commissioner, he sported pins for Lamb wherever he went and was ready for naysayers.

“I tell people that the first thing you got to do is vote for your paycheck and lobby your hobby,” he said. “If you don’t do that, you’re hurting yourself.”

He had many conversations like the one with a man who condemned Lamb based on unfounded claims in a campaign ad. Boldyzar told him about Saccone’s unwavering anti-worker voting record in the statehouse.

“I said, ‘You’re going to go by a commercial that you saw on TV and not do any research?’ He said, ‘Hank, you’re kind of right.’ I said, ‘I’m exactly right.’”

Boldyzar, who has political ambitions himself, hopes Democrats have learned that rejecting pro-union candidates in the past was a mistake.

“A lot of good labor candidates got passed over,” he said. “We just showed you what can happen when labor gets up and gets going.”