The Islamic State (IS) militant group claimed responsibility for the attack in the western city of Quetta, where security sources said the bomber drove his motorcycle into a police vehicle.
A hospital spokesperson said 29 people were killed and 35 others were wounded in the attack that a witness said occurred near a voting centre in the city, which is the capital of Baluchistan province.
A suicide bomber killed 149 people at an election rally in the town of Mastung in Baluchistan province earlier this month. That attack was also claimed by IS militants.
About 371000 soldiers have been stationed at polling stations across the country to prevent attacks, nearly five times the number deployed at the last election in 2013.
According to the latest opinion polls, neither Khan nor Sharif are likely to win a clear majority.
Khan has emerged as a slight favourite in national opinion polls but the divisive race is likely to come down to Punjab, the country’s most populous province, where Sharif’s party has clung to its lead in recent surveys.
The election has been plagued by allegations of powerful armed forces trying to tilt the race in Khan’s favour after falling out with the outgoing ruling party of Sharif, who was jailed on corruption charges this month.
“Imran Khan is the only hope to change destiny of our country. We are here to support him in his fight against corruption,” said Tufail Aziz, 31, after casting his ballot in the north-western city of Peshawar.
About 106 million people were registered to vote in polls due to close at 6pm. The likely winner was expected to be known this morning.
Whichever party wins, it would face a mounting and urgent in-tray, from a brewing economic crisis to worsening relations with on-off ally the US and deepening cross-country water shortages.
Khan, an anti-corruption crusader, has promised an “Islamic welfare state” and cast his populist campaign as a battle to topple a predatory political elite hindering development in the impoverished mostly-Muslim nation of 208 million people, where the illiteracy rate hovers above 40%.
“This is the most important election in Pakistan’s history,” Khan, 65, said after casting his vote in the capital Islamabad.
“I ask everyone today to cherish this country, worry about this country, use your vote.”
Khan has staunchly denied allegations by Sharif’s Pakistan Muslim League-Nawaz (PML-N) party that he is getting help from the military, which has ruled Pakistan for about half of its history and still sets key security and foreign policy in the nuclear-armed nation. The army has also dismissed allegations of meddling in the election.
Khan’s Pakistan Tehreek-e-Insaf (PTI) party has inched ahead in recent national polls, but even if it gets the most votes, it will likely struggle to win a majority of the 272 elected seats in the National Assembly, raising the prospect of weeks of haggling to form a messy coalition government. Such a delay could further endanger Pakistan’s economy, with a looming currency crisis expected to force the new government to turn to the International Monetary Fund for Pakistan’s second bailout since 2013. PTI has not ruled out seeking succour from China, Islamabad’s closest ally.
Sharif’s PML-N has sought to turn the vote into a referendum on Pakistan’s democracy, and has said it was campaigning to protect the “sanctity of the vote”.
The Pakistan Peoples Party, which was overtaken by Khan’s PTI as the main challenger to PML-N, but seen as the kingmaker, also alleged intimidation by spy agencies.
Sharif’s PML-N has been touting its delivery of mega-infrastructure projects, especially roads and power stations, that helped hugely reduce power blackouts, as proof the country is on the path to prosperity.
The election will be only the second civilian transfer of power in Pakistan’s history.