Islamic State has claimed responsibility for an explosion near a polling station in Quetta on Pakistan's election day, according to the group's AMAQ news agency.

The group said the attack was carried out by a suicide bomber but did not provide further detail or evidence for its claim.

Pakistanis voted Wednesday in elections that could propel former World Cup cricketer Imran Khan to power, as security fears intensified with a blast that killed at least 31.

AAP

Thirty-five people were injured in the bombing, the second this month in Balochistan province after another attack claimed by Islamic State group killed 153 people.

"(The bomber) was trying to enter the polling station. When police tried to stop him he blew himself up," a local administration official, Hashim Ghilzai, told AFP.

Nearly 106 million people were eligible to vote in the parliamentary election in what is meant to be a rare democratic transition in the nuclear-armed country, which has been ruled by the powerful military for roughly half its history.

Twitter/Shazadi Baloch

But the vote has been dubbed Pakistan's "dirtiest election" due to widespread accusations of pre-poll rigging by the armed forces, with Khan - who captained his country to victory in the 1992 cricket World Cup - believed to be the beneficiary.

The campaign season was also marred by the expansion of extremist religious parties.

The contest has largely become a two-way race between Khan's Pakistan Tehreek-e-Insaf (PTI), and the incumbent Pakistan Muslim League-Nawaz (PML-N) of ousted premier Nawaz Sharif, whose brother Shahbaz is leading its campaign.

Khan cast his vote in Bani Gala, a suburb of the capital Islamabad, telling the media it was "time to defeat parties which kept this country hostage for years".

🔴 #Pakistan media reports say at least 22 people have been killed following a blast in the city of #Quetta during election day in the country.

📸 pic.twitter.com/xuMMZpZAQD — Mete Sohtaoğlu (@metesohtaoglu) July 25, 2018

The first voter to enter a polling station in the eastern city of Lahore was a woman, business executive Maryum Arif, who told AFP she planned to vote for the PML-N as "it has served Pakistan".

She was followed shortly after by Shahbaz Sharif, who called on Pakistanis to "get out of their homes and ... change the fate of Pakistan" before casting his own vote and flashing a victory sign.

Up to 800,000 police and troops have been stationed at more than 85,000 polling stations across the country, with concerns for security after a string of bloody militant attacks in the final weeks of the campaign that killed more than 180 people including three candidates.

Getty

An earlier attack in Balochistan Wednesday left one policeman dead and three wounded when a hand grenade was thrown at a polling station in the village of Koshk.

In the northwestern town of Swabi one PTI worker was killed in an exchange of fire with a rival party, police said.

However, security fears did not deter Arif, the first voter at the polling station in Lahore, who told AFP that "the law and order situation is fine here".

AAP

'Murky'

Khan is campaigning on populist promises to build a "New Pakistan", vowing to eradicate corruption, clean up the environment and construct an "Islamic welfare" state.

But the erstwhile playboy's campaign has been dogged by widespread accusations he is benefiting from the support of the country's powerful security establishment, with the media, activists and think tanks decrying a "silent coup" by the generals.

The military has rejected the accusations and said it has no "direct role" in the electoral process.

Election authorities have granted military officers broad powers inside polling centres that have further stirred fears of manipulation.

Getty

Khan has also raised eyebrows in recent weeks by increasingly catering to hardline religious groups, particularly over the inflammatory issue of blasphemy - sparking fears a win for PTI could embolden Islamist extremists.

The PML-N says it is the target of the alleged military machinations, with candidates under pressure. Nawaz Sharif was ousted from power last year and jailed over a corruption conviction days before the vote, removing Khan's most dangerous rival.

A third party, the Pakistan Peoples Party headed by Bilawal Bhutto Zardari - son of slain prime minister Benazir Bhutto - could be called upon to form a coalition with any winner.

Radical groups such as the Milli Muslim League, linked to Hafiz Saeed, the man accused of masterminding the 2008 Mumbai attacks, are also contesting the polls, though many are running under the banner of smaller, lesser-known parties.

AAP

More than 19 million new voters, including millions of women and young people, may prove decisive.

"Our predictions are very murky right now. It's still up for grabs," Bilal Gilani, executive director of pollster Gallup Pakistan, told AFP on Tuesday.