As Pakistani voters headed to the polls Wednesday to decide who the country’s next prime minister will be, a suicide bomber attacked a polling station in the northwestern city Quetta, leaving at least 31 people dead and more than 40 wounded. The bombing follows a string of deadly attacks that have killed dozens of people leading up to the high-stakes election.

Abdul Haleem, a witness to the bombing who was at the polling station to cast his ballot, told the Associated Press that he saw the attacker drive a motorcycle into the mass of people moments before the explosion. “There was a deafening bang followed by thick cloud of smoke and dust and so much crying from the wounded people,” Haleem told the AP.

Pakistani citizens were voting for members of the lower house of Pakistan’s parliament, the National Assembly. Whichever party wins a majority in the Assembly will form a government and then appoint a prime minister.

The election is a tight race between two main competing parties — the incumbent Pakistan Muslim League-Nawaz (PML-N) party, which has been plagued by corruption scandals, and the Pakistan Tehreek-e-Insaf (PTI) party, which is backing political newcomer and former cricket superstar Imran Khan for prime minister.

The polls have closed, and results are expected to be announced within the next day.

Deadly attacks have ramped up leading up to the election

The attack on Pakistan’s election day follows several other bloody attacks, some of which have been claimed by the Pakistani Taliban, that has shaken up the country.

Just last Sunday, PTI candidate Ikramullah Gandapur was killed by a suicide bomber in an attack that also wounded four others. And Pakistan’s Baluchistan province, where Quetta is located, saw an attack just a few weeks ago at a campaign rally that left more than 128 people dead.

But the deadliest attack took place earlier this month at a political rally in the northwestern town of Mastung, where a bombing killed 151 people and wounded 177.

“Security agencies have failed to provide us security,” Lashkari Raisani, whose brother, a political candidate, was killed in the Mastung attack, told the New York Times. “We are paying with our blood.”

The multiple campaign attacks have killed more than 200 people, but the exact death toll since the start of the election season is unknown.

The wave of violence prompted greater security measures for the country’s election day; Pakistan’s military deployed 371,000 soldiers at the polling stations on Wednesday.

The militant groups have targeted people across the political spectrum in an effort to destabilize the election — in 2013, the Pakistani Taliban said it regarded the general elections as “un-Islamic.”

“If somebody doesn’t have a lot of security and they’re conducting a rally, that’s an easy target,” Madiha Afzal, a nonresident fellow at the Brookings Institution, told me shortly before the election. Afzal added that the groups will “target whoever they possibly can,” including “politicians who are most opposed to the idea of an Islamic Pakistan.”