Democrat Conor Lamb held a lead of a few hundred votes Wednesday with the final absentee and provisional ballots still being counted in Tuesday’s special election for a Pennsylvania congressional seat, leaving the race too close to call. His strong showing – and likely victory – has important lessons for Democrats for the November elections, when all 435 House seats will be on the ballot.

The Pittsburgh Post-Gazette reported that Republican officials are alleging voting irregularities and plan to seek a court order impounding voting machines in four counties in the district pending a recount.

A victory by Lamb over Republican Rick Saccone in the 18th congressional district near Pittsburgh would be a major upset in a district that voted for Donald Trump by a margin of nearly 20 points in the 2016 presidential race. In the past two congressional elections, Democrats didn’t even field a candidate in the solidly Republican district.

Lamb’s ability to draw so many votes demonstrates that there is a viable, centrist path to victory for Democrats, even in places where President Trump won by double-digit margins.

Notably, Lamb was outspent by Saccone and his allies by a ratio of approximately 5-to-1. Surely, Republicans cannot spend in this way nationwide to retain competitive seats, underscoring their vulnerability.

For these reasons, Lamb’s performance has major negative implications for continued Republican control of the House and vindicates the critical importance of Democrats taking a centrist approach to the most competitive races.

If the Democrats want to win back the red and swing districts lost to President Trump in 2016, they must follow Lamb’s example and take moderate positions on key issues that are in line with their constituents.

Lamb promised to work with leaders of both parties to take immediate action on the opioid epidemic. He also put forward a plan to work with Republican leaders to stop stalling on infrastructure investment and move forward on multiple projects, as well as job training initiatives.

Lamb even supported President Trump’s imposition of heavy tariffs on aluminum and steel imports, two industries that are critical to western Pennsylvania’s economy.

In addition, Lamb took important strides to distance himself from House Minority Leader Nancy Pelosi, D-Calif., openly stating that if elected he would not support her bid to retain her leadership position come November.

Like Lamb, Democratic candidates must take positions that swing voters, especially those who have traditionally voted for Democrats and only recently defected to the Republican Party, can support.

These are voters who applauded the recent tax cuts – the same cuts that Nancy Pelosi infamously called “crumbs.”

These voters – especially those who voted for President Obama in 2008 or 2012 and then President Trump in 2016 – support working-class families, particularly members of local unions, and worry about their future financial security.

Indeed, Democrats must not only campaign as centrists but also govern as centrists. This is the key to not only welcoming voters back into the party, but also retaining them in 2020

To be sure, Lamb’s big vote totals and likely victory in Pennsylvania are a wake-up call for Democrats and Republicans alike.

Saccone’s failure to win an easy victory indicates that the White House and the Republican Party more generally may not be fully prepared for what is at stake in November.

President Trump and Republican leaders will receive credit for the legislative accomplishment of tax cuts and for taking steps toward de-escalation of tensions with North Korea. This may benefit GOP candidates for the House and Senate.

But these accomplishments may just as easily get lost in the large set of problems facing the Republican Party, including seemingly unending turnover at the White House and in the president’s cabinet, along with inaction on the increasingly important issues of health care reform and gun violence prevention.

Ultimately, if Democrats are to retake the House in November, they must turn to the moderate center once again.

The Democrats have a major opportunity to build on Lamb’s strong performance in Pennsylvania and potentially flip seats nationwide. Above all, this will require a strategy that attracts, rather than divides, voters and presents an effective alternative to the current Republican Congress.