It was targeted by the Taliban, women and minorities were vastly under-represented, and videos of irregularities went viral online -- yet Pakistan's 2013 election may still have been its fairest ever.
A much improved voter roll, near-record turnout, and vigilant citizens tweeting alleged rigging all played their part in what former Norwegian PM and election observer Kjell Magne Bondevik called "a credible expression of the will of the people".
Violence in the run-up to polls and on election day itself killed more than 150 people, according to an AFP tally, as the Taliban set their sights in particular on secular parties that made up the outgoing government.
More From This Section
"The results of May 11 elections prove once again that if given the opportunity, Pakistani masses would embrace democracy against the religious orthodoxy," he wrote in Dawn, one of the country's leading English language newspapers.
"The main thing was serious interest in the election and we have a very heavy participation by women everywhere. So I think this was a good election," said IA Rehman, a veteran human rights activist.
Some of the credit goes to Pakistan's database authority, which oversaw an increase in the registration of women from 50 per cent during the last polls to 86 per cent by adding all adults with an ID card to the voter roll.
The agency culled the dead from the electoral roll, and clamped down on ID card fraud that resulted in some people voting dozens of times in the last election.
It put in place measures that allowed polling stations to access would-be voters' photographs and even check thumb impressions against the national database in cases of suspected fraud.
The agency also allowed voters to SMS their ID card number to instantly find which polling station they should use -- a serviced accessed 55 million times.
"Technology has strengthened democracy in Pakistan, enhanced turnout, eroded corruption and enhanced transparency," Tariq Malik, chairman of the National Database Registration Authority, told AFP.
But he warned that technology can only do so much and poll officials remained susceptible to corruption.