Pakistanis begin voting in a knife-edge general election between former cricketer Imran Khan against the party of jailed ex-Prime Minister Nawaz Sharif.

The polling stations opened at 8:00 am Pakistan time and will close at 6:00 p.m. 

Pakistan's election authorities have granted broad judicial powers to the powerful military at the stations during voting. Some 800,000 security personnel, including 371,388 soldiers, are dispatched across Pakistan, about three times the number during the last election in 2013.

Over 105 million registered Pakistanis will determine the fate of nearly 12,000 candidates vying for 849 national and provincial seats. As many as 120 observers from the European Union Election Observation Mission (EUEOM) are posted throughout the country. Former Nigerian President Abdulsalami Abubakar leads the 24-member team from the Commonwealth.

Nationwide polls indicate a tight race is expected between cricketer-turned-politician Imran Khan's Pakistan Tehreek-e-Insaf (PTI) party and the brother of jailed ex-Prime Minister, Nawaz Sharif, Shehbaz Sharif's Pakistan Muslim League-Nawaz (PML-N). The third major party Pakistan Peoples Party (PPP) is represented by the 29-year-old son of late former Prime Minister Benazir Bhutto, Bilawal Bhutto-Zardari.

The vote, however, has been dubbed the “dirtiest election” due to allegations of widespread pre-poll rigging by the armed forces, with Khan believed to be the beneficiary.

A judge in the High Court of Islamabad appeared to back up the allegations on Sunday, claiming that the military Inter-Services Intelligence (ISI) had been interfering in the judiciary.

The powerful military, whose ruling fell out in 2007 by the outgoing party of Sharif, however, denies any involvement.

But the independent Human Rights Commission of Pakistan (HRCP) has said there are "ample grounds to doubt" the legitimacy of the elections and criticized "blatant, aggressive and unabashed attempts to manipulate the outcome."

The run-up to the elections has seen a massive crackdown on the media with many journalists saying they have suffered intimidation for their reporting.

Up to 800,000 police and military forces have been stationed across the country to secure tens of thousands of polling stations.

Dozens of people have been killed in multiple violent attacks, some between rival party supporters. 

The results of the elections are expected within 24 hours.