The election's outcome is likely riding on the tally in the province of Punjab, Pakistan's most populous, where Sharif and Khan have been dueling for the people's support with a series of large rallies and campaign events.
Even on election day the excitement was evident. In Lahore, which has not been touched by the pre-election violence seen in other parts of Pakistan, Sharif supporters carried stuffed tigers — the party's election symbol — and Khan followers carried cricket bats as they chanted slogans in favor of their candidates.
As Sharif cast his ballot at a Lahore voting station, supporters serenaded him with chants of "Lion! Lion!"
"We brought change before. We will bring change again," he said.
On the campaign trail, Sharif played up his extensive political experience compared to Khan's, and touted key projects he completed while in office, including a highway between the capital Islamabad and Lahore.
"It's better to try a lesser evil instead of trying a novice," said one Lahore voter, Haji Mohammad Younus. "The lesser evils at least have the experience of governing. They might be corrupt but they have lately realized that they have to deliver if they want to survive."
The mood remained jubilant despite a series of attacks that marred the vote in some districts.
The deadliest violence struck Karachi, where twin blasts blew up outside an office of the Awami National Party, one of three secular liberal parties that have been targeted by Taliban militants during the campaign, said police officer Shabir Hussain. Ten people died in the attack and 30 were wounded.
A roadside bomb in Karachi also killed one person riding in a bus of ANP supporters, while in the northwestern city of Peshawar a blast outside a polling station killed one person and wounded 10 others.