WHEN Tim Murphy resigned from his post as the representative for Pennsylvania’s 18th congressional district, Republicans had a heavy load lifted from their shoulders. Mr Murphy, publicly a social conservative, was caught sending text messages to his mistress urging her to have an abortion. His re-election campaign would have road-tested the proposition that partisanship covers all sins. The outlook for Republicans was looking good for the special election that takes place on March 13th to replace him, until it wasn’t. Republican state representative and Harrisburg insider Rick Saccone will face off against a former marine and assistant US attorney, Conor Lamb. Republicans have spent more than $9m to preserve control of a district President Donald Trump won by 20 points. They have reason to worry even that sum might not be enough.

Since Mr Murphy’s resignation in October, there have been 49 special elections to state legislatures and Congress. Democrats in these contests have on average performed 14 percentage points better than Hillary Clinton did in the 2016 election. Democrats flipped control of 12 Republican-held seats in these elections. If this pattern holds true in Pennsylvania’s 18th district, Mr Saccone would win by six points. That in a seat deemed so safe that Mr Murphy ran unopposed in 2014 and 2016.

Mr Lamb has been touting his credentials as a captain in the Marine Corps, a solid strategy for a rural, white district. He has also taken advantage of support from Democratic figures like Joe Biden to capitalise on the party’s apparent edge in voter mobilisation. He took a bipartisan stance on gun reform after the massacre at a Florida school in late February, saying he would not support a ban on assault weapons and would focus instead on expanding background checks and mental-health reform. Meanwhile Mr Saccone has followed identikit Trumpian messaging on immigration, taxes and health care.