Conor Lamb, the Democratic nominee for Congress in Tuesday’s special election in Pennsylvania, has won a district that went for Donald Trump overwhelmingly just 17 months ago. How did he do it?

Conservatives say Lamb ran as a centrist. Progressives say he relied on unions and defended government programs. They’re both correct. Lamb won with a combination of triangulation and jiujitsu. He showed that you can punish the right while hugging the middle.

Republicans did everything they could to polarize this contest. GOP nominee Rick Saccone, the National Republican Congressional Committee, and Trump administration surrogates tried to tie Lamb to House Minority Leader Nancy Pelosi. Saccone talked constantly about “the left” and advancing Trump’s “agenda.”

Lamb ducked that fight. He left the Trump-bashing to others. He spoke of bipartisanship and rejected “ideology.” He praised Republican Sen. Lindsey Graham. “We’ve had enough of agendas,” Lamb argued in his closing remarks at the campaign’s final debate. “We need someone to get to work, to do the job.”

But Lamb, a former Marine, didn’t flee the political battlefield. He changed it. He picked his fights shrewdly and turned defense into offense. On tax cuts, he said he was happy that the middle class got a break in last year’s Republican bill. But he distinguished that from the GOP’s corporate and top-bracket tax cuts, which, he explained, comprised the bulk of the bill and were now leading to massive deficits. The next step, he warned voters, was that House Speaker Paul Ryan would close those deficits by cutting their Social Security, Medicare, and Medicaid.

Lamb hammered the proposed cuts at every opportunity. He didn’t just say they would hurt people. He framed them as an attack on conservative values, betraying workers to fund “corporate welfare” and a “giveaway” to the rich. “Paul Ryan will use the term ‘entitlement reform’ to talk about Social Security and Medicare, as if it’s undeserved, or it’s some form of welfare,” Lamb scoffed in a TV ad. “People paid for it. They worked hard for it. And they expect us to keep our promises to them.” Wrapping up a debate, he pledged to “keep the promises that we made to the people that built this country.”

Lamb also used the tax cuts as political leverage on health care. Because of the GOP’s assault on Obamacare, he warned, “Many Pennsylvanians will have their tax cut wiped out by higher health care premiums.” Lamb never called it Obamacare, and he said he didn’t support a “government-run” single-payer system. But he also told voters that rich people on Wall Street had no interest in reducing premiums for ordinary families. He called for “putting the teeth back in the Affordable Care Act, so that people have health care they can actually afford.”

Steel is important in western Pennsylvania, so Lamb didn’t quarrel with Trump’s tariffs.

In fact, he accused Saccone of voting “repeatedly to allow, in our public construction projects, the use of foreign steel.” From this issue, Lamb pivoted to infrastructure investment, calling it “the one thing that would create jobs in our district tomorrow.” Congress shouldn’t just protect steel, he argued. It should “use the steel to rebuild our bridges.”

On guns, Lamb guarded his right flank. He touted his experience as a Marine. A biographical ad assured voters that he “still loves to shoot.” He praised the Second Amendment and rejected legislation that would ban assault weapons or high-capacity magazines. But Lamb also accused Saccone of extremism. “He’s called for the elimination of the background check system here in Pennsylvania,” said Lamb. “I support universal background checks. No loopholes, period.”

Saccone tried to use the abortion issue to pry Catholic Democrats away from Lamb. “He flunked his basic Catholic catechism, because right-to-life is part of that basic Catholic catechism,” Saccone charged in a debate. But Lamb’s ads reminded voters that he had attended Catholic school. In debates, he explained that while he believed life began at conception, he couldn’t impose that view on people of other faiths. To turn Catholics against Saccone, he pivoted to Medicaid. “We know that Mr. Saccone is in favor of cuts,” he said. “If you want to stick up for life, you have to do it from cradle to grave.”

On issue after issue, Lamb claimed the middle ground. Saccone claimed to represent “coal country” against a “downtown Pittsburgh liberal.” Lamb, in reply, talked about clean energy rather than coal, but he also noted that he supported drilling for natural gas, unlike Democrats who, he said, were “so far to the left” that they would block it. Saccone opposed any increase in the minimum wage. Lamb said $15 per hour was too high for western Pennsylvania, but $10 seemed about right.

Some of Lamb’s maneuvers required military credentials that most Democratic candidates can’t replicate. He used his service in the Marines to appeal for caution on the Korean peninsula (“We have a lot of young men and women wearing our nation’s uniform who are serving in harm’s way”), defend Special Counsel Robert Mueller (“a decorated Marine”), and preach economic equality with an air of gallantry (“Officers eat last”). He also used it to moralize an otherwise routine indictment of Congress for nonperformance. “In the military,” he explained in an ad, “when you don’t get the job done, you get relieved.”

But much of what Lamb did can be tried elsewhere. He reached back to an era when Democrats ruled the country. “Franklin Roosevelt said that there was one test people expected of the Democratic Party,” he told an audience. “They just wanted their government to walk on the same side of the street that they did.” As his villain, Lamb chose Ryan, not Trump. “People are telling me every day how insulted they are when they hear Paul Ryan refer to [Social Security] as an entitlement,” said Lamb. He accused Saccone of following Ryan’s “anti-middle-class, anti-American legislative agenda.”

Early Wednesday morning, as the final votes were tallied, Lamb declared victory. He told his supporters: “Our job in Congress is to attack the problems, not each other.” But that’s not how he won the job. He did it with balance, guile, and ferocity. If you want to win like he did, don’t be a lamb. Be a Marine.