ATOP a hill sits St Bernard, a Catholic church with glorious murals depicting scenes from the book of Revelation. Next to it is the similarly impressive Mount Lebanon Evangelical Presbyterian church. And to its right is the Mount Lebanon United Methodist church. Worshippers at the three adjoining grand churches in this hilly suburb of Pittsburgh are assiduous Christians, mostly middle- and working-class and overwhelmingly white. They are pretty representative of the electorate of Pennsylvania’s bizarrely shaped 18th congressional district, which consists of a slice of Pittsburgh’s suburbs and a slew of small rural manufacturing towns.

PA-18 should be a shoo-in for the Republican Party at a special election on March 13th. Tim Murphy, the Republican congressman who represented the district for eight terms, did not even have an opponent when he ran in 2014 and 2016. The avid pro-lifer, who was popular with the district’s churchgoers, was compelled to resign last year after revelations that he asked a woman half his age to abort their unborn child. This triggered the special election. President Donald Trump won PA-18 by 19 points over Hillary Clinton in November 2016. The nonpartisan Cook Political Report rates it as having an 11-point Republican lean. A Democrat has not represented the district since 2002 when its boundaries were redrawn.

Even so, Rick Saccone, the state representative who is the Republican candidate, is struggling to maintain his lead in a race that has come to be seen as a bellwether of the midterm elections in November. A poll published by Emerson College, a private university in Boston, using data collected on the first three days of March, shows Conor Lamb, the Democratic candidate, leading Mr Saccone with 48% to 45%. Mr Lamb is leading 57% to 40% in Allegheny County, which accounts for more than 40% of the vote. PredictIt, a political betting-market, has Mr Lamb as a slight favourite.

The Emerson poll results are within the margin of error of 4.8 percentage points and until recently polls unanimously predicted at least a narrow victory for Mr Saccone. The average of polls taken since February 12th suggests that Mr Lamb is running two percentage points behind Mr Saccone. And yet the momentum seems to be on Mr Lamb’s side. On March 6th Joe Biden, the popular former vice-president, led a gathering of more than 700 at the Robert Morris University campus in Moon township to give Mr Lamb a boost. He paid Mr Lamb a huge compliment, saying that he reminded him of Beau, the son he lost to cancer in 2015, because both served in the military and cared about helping others. On March 9th the steelworkers’ union organised a last-minute rally to get their troops to vote.

Nervous Republicans are pulling out all the stops. Mr Trump travelled to Pittsburgh on March 10th to tout the 25% tariffs he intends to slap on steel imports, his second visit on behalf of Mr Saccone. In a freewheeling speech he barely mentioned Mr Saccone (though he called him “handsome”) and instead talked about North Korea (“let’s see what happens”), his criticism of sanctuary cities, the wall on the southern border (“we are building the wall 100%”) being presidential (“I am very presidential”) and other familiar topics. He insulted adversaries more than usual, calling Maxine Walters, a black congresswoman who is a frequent critic, a “very low IQ individual” and Chuck Todd, a television news anchor, a “sleeping son of a bitch”.

The president’s protectionism is popular in the Steel City, which once produced half of the nation’s steel. Ivanka Trump, the president's daughter, recently appeared next to Mr Saccone in Mount Lebanon. On March 8th Kellyanne Conway, a close aide of Mr Trump's, attended a dinner on the outskirts of Pittsburgh with Mr Saccone, which, given Ms Conway’s troubles over an alleged violation of the Hatch act, a law from 1939 that seeks to keep government officials non-partisan, might not have been especially helpful. Donald Trump junior, the president’s oldest son, will campaign with Mr Saccone on March 12th, the eve of the election.

What happened to make this such a hotly contested election? Mr Lamb is a hugely attractive candidate. The 33-year-old former Marine is photogenic, trim, well-spoken and from an established Pittsburgh family with a distinguished record in public service. As a former federal prosecutor, he led aggressive prosecutions against drug dealers, which makes him popular in communities in western Pennsylvania hit especially hard by the opioid epidemic. A moderate Democrat, who occasionally sounds like a Republican, Mr Lamb is a savvy user of social media who revealed himself to be a prodigious fund-raiser. He outraised Mr Saccone by a nearly five-to-one margin in the first two months of the year with a haul of almost $4m compared with less than $1m raised by his opponent.

Mr Saccone is a portly 60-year-old, who is also a veteran, and has been a state representative since 2011. He was an early supporter of the president who called himself “Trump before Trump was Trump”. A member of the Christian right, he is pro-life, anti-union, pro-gun and a fierce defender of the second amendment. His idea of using social media is to post an amateurish video of himself next to Father Christmas at a veterans’ party and encourage Santa to cry “ho, ho, ho”.

Republican groups from outside the state have given Mr Saccone donations of $9m. These out-of-state dollars give the embattled state representative lots of firepower on the airwaves, but they are putting off many local voters who say they do not want to be patronised by opaque groups. Congressional Leadership Fund, the super PAC with ties to Paul Ryan, the Speaker of the House, forked out more than $3m. The National Republican Congressional Committee nearly matched that sum.

With unprecedented millions lavished on wooing voters the people of Pittsburgh and surroundings have been overwhelmed by the relentless advertising on television from both sides. Many of the ads are negative and lack substance. One Republican ad portrays Mr Lamb, who insists he will not back Nancy Pelosi, the minority leader at the House, as a sheep of Ms Pelosi who would immediately join her liberal flock once in Washington, DC. (Mr Trump called him “Lamb the sham” in his speech.) Another ad claims Mr Lamb wants to help Ms Pelosi give amnesty to millions of illegal immigrants. An ad by Mr Lamb, meanwhile, suggests that Republicans are coming after Medicaid, Medicare and Social Security. Another accuses Mr Saccone of being a typical politician who talks tough on spending cuts but runs up huge bills on his expense account.

Whoever wins on March 13th will have only a short time to savour his victory. The Supreme Court of Pennsylvania imposed new congressional-district lines for the primaries in May and the general election in November. Neither candidate lives in the new district that will be formed according to the court’s plan. The winner will have to decide whether to run again in a new district in just two months.