The Republican candidate’s narrow loss in Pennsylvania’s special election has set off alarm bells as the party approaches the midterms

The Democrat Conor Lamb has pulled off a major upset against his Republican opponent Rick Saccone in Pennsylvania.

Despite Donald Trump taking the 18th congressional district by 20 percentage points in 2016, Lamb was able to edge out Saccone by 627 votes. Although provisional and military ballots had yet to be counted, the number of outstanding ballots was reportedly less than Lamb’s lead.

It may have been the narrowest of victories, but it has sent the biggest electoral warning to Republicans since Trump won the White House.

The district where Lamb triumphed is known for being staunchly conservative. What’s more, over $10m of outside spending, in addition to the money from his own campaign, was put behind Saccone leading up to the election. But by the final count it did not matter.

Here are the numbers behind the election: