(BBC) – Violence has erupted as millions head to the polls in Pakistan, with at least 31 dead in the worst attack, a bomb in the city of Quetta.
Elsewhere, minor blasts and clashes between party workers left several injured and two dead.
Opinion polls suggest the election battle will be between the parties of ex-cricket star Imran Khan and the disgraced former PM Nawaz Sharif.
But the campaign has been overshadowed by concerns of fraud and violence.
The Human Rights Commission of Pakistan says there have been “blatant” attempts to manipulate the polls.
Mr Khan has vowed to tackle corruption but his rivals accuse him of benefiting from alleged meddling by the military, which has ruled Pakistan for nearly half of its history.
Mr Sharif, who won the last election, has been jailed for corruption after a scandal stemming from the Panama Papers leak.
Polling is due to end at 18:00 (13:00 GMT), with results probably known early on Thursday.
How bad is the violence?
Despite tight security, with hundreds of thousands of troops and police officers deployed across the country, there have been incidents.
Officials say the attack in Quetta, in Balochistan province, was the work of a suicide bomber targeting police at the gate of a polling station. The Islamic State (IS) group said it was behind the attack.
An IS-claimed attack targeting a political rally earlier this month in nearby Mastung killed at least 149 people.
On Wednesday, there were reports of a death in a grenade attack in Khuzdar, also in Balochistan, and another in a shooting between political rivals in Swabi, Khyber Pakhtunkhwa province.
The Dawn newspaper also reported clashes in Mardan, Rajanpur, Khipro and Kohistan.
What’s the context for this vote?
Pakistan has been ruled on and off by the military during its 71-year history. This election is significant because it will mark only the second time that one civilian government has handed power to another after serving a full term.
But the run-up to the vote has been controversial.
Mr Sharif’s Pakistan Muslim League-Nawaz (PML-N) complains of a targeted crackdown by the security establishment, with the alleged help of the courts, in favour of Imran Khan and his Pakistan Tehreek-e-Insaf (PTI).
On Sunday, a judge in the High Court of Islamabad appeared to support that allegation, saying that the military Inter-Services Intelligence (ISI) organisation had been interfering in the judiciary.
In a BBC interview on Monday, Mr Sharif’s daughter Maryam Nawaz – who was jailed earlier this month with her father on related charges – criticised the military.
“When a prime minister refuses to put down his head and do their [the military’s] bidding, they pull him down with four things; get a religious fatwa issued against him, call him a traitor, call him a friend of India, or call him corrupt. They use these things against every elected prime minister,” she said.
Several PML-N candidates also say they have been coerced to switch to the PTI. The Pakistani military denies interfering in politics.
Independent media, meanwhile, say there have been blatant attempts to muzzle them. There are also concerns about the participation of internationally designated militants in the election process.
For all these reasons, the human rights commission has said there are “ample grounds” to question the legitimacy of the polls, “with alarming implications for Pakistan’s transition to an effective democracy”.