Supporters of the Pakistan Movement for Justice wave their party flags at a rally in Islamabad in July. (Aamir Qureshi/AFP/Getty Images)

Precinct 120 is a small pocket of a sprawling city, with less than 340,000 voters amid a hodgepodge of slums, shrines and stately monuments. It is also the electoral heart of a political dynasty that has long ruled Pakistan's wealthiest, most influential province and made Mian Nawaz Sharif the country's prime minister three times.

On Sunday, voters there will select someone to fill the National Assembly seat vacated by Sharif, who was ousted July 28 by the Supreme Court. In essence, they will choose between competing images of the former premier: one as an example of the corrupt political elite; the other as the victim of an establishment plot to remove an independent, popular leader.

Deposed Pakistani Prime Minister Nawaz Sharif addresses a crowd on Pakistan Independence Day in Lahore in August. (Lahore/AP)

The pro-Sharif side is likely to win by a solid margin, polls show, but the race has been skewed by new legal battles for the Sharifs, electoral muscle-testing by religious groups, and a confusing cast of absent and proxy candidates. All of this has distracted attention from the larger struggle for Pakistani democracy at stake.

Even a strong showing by Sharif’s Pakistan Muslim League-N, analysts said, may not revive its larger fortunes or restore calm as national elections loom next year. Months of upheaval have created a swirl of shifting political forces and revealed deeper institutional struggles.

"The cry for 'change' becomes ever more shrill," Najam Sethi, publisher of the Friday Times newspaper, wrote recently. It appears to be "an angry rally" against corruption, "but the underlying reality is more unsettling." Frustrated people are looking to the military and Islam, he warned, but only with elected civilians in charge does Pakistan "have a chance of reinventing a new democracy."

One anomaly in the current race is that neither of its two dominant figures — Sharif’s daughter Maryam Nawaz, 43, who has barnstormed the constituency known as NA-120, and Imran Khan, 64, the former cricket star and rabble-rousing opposition leader — are on the ballot.

Maryam Nawaz, the daughter of Pakistan's former prime minister, poses with a supporter at a rally in Lahore. (Drazen Jorgic/Reuters)

Nawaz is standing in for her mother, Kulsoom, the official candidate, who is hospitalized in London with lymphoma. She is also representing her father, calling on voters to avenge Sharif's "betrayal" and stand up for "the sanctity of the vote" that elected him in 2013. He has been temporarily replaced by Shahid Khaqan Abbasi, a former cabinet minister.

Traveling to rallies in a convoy of SUVs with heavy security, Nawaz is feted with rose petals, music and fireworks. At a meeting Tuesday with religious minority groups, she stressed her father’s support for an “inclusive” Pakistan that respects all faiths. When she asked the audience to “bring back the lion,” the Sharif party’s symbol, people shouted, “Lion! Lion!” in response.

In an interview later, she spoke angrily of the Supreme Court ruling. “This was not about corruption. This was a ruse, a ploy, to get rid of him,” she said, describing her father as “the only real leader” in Pakistan with the courage to “call a spade a spade.” She declined to elaborate, but other Sharif aides described him as challenging the army and other state institutions.

Khan, who heads the Pakistan Movement for Justice, is supplying the passion that its candidate, a medical doctor named Yasmin Rashid, 67, is at pains to display. She is effusive when talking about medical research, but on the campaign trail, she murmurs that she hopes people will vote for her. Khan, whose party symbol is a cricket bat, paints the race as a fight between good and evil.

Yasmin Rashid greets voters in her campaign to fill ousted prime minister Nawaz Sharif's seat in parliament. (Pam Constable/The Washington Post)

“This is not an ordinary election. It is a decision for the future of Pakistan,” he thundered in a campaign speech here last week. He called on voters to “tell all of Pakistan” that “the most powerful robber of this country” was declared unfit to lead. “Your vote will strengthen the system to take action against other and bigger robbers,” he vowed.

Nawaz's defense of her family is hampered by the legal battles they still face. In a court challenge spearheaded by Khan, Sharif was accused of hiding assets abroad and failing to explain how he paid for apartments in London; Nawaz was accused of concealing her ownership role in them.

Both deny the allegations, but with the election days away, the case continues to intrude. An anti-corruption court has filed cases against the Sharifs and ordered them to appear by Tuesday.

Despite Rashid’s more modest campaign, her message of bringing change seems to be resonating with voters; she is expected to come in second. On Wednesday, as she inched her way through cramped markets in sweltering heat, followed by a single sound truck, people greeted her warmly.

“We have been waiting for you for a long time,” said Mohammed Nadeem, 35, a garment worker. “We need a new generation in politics,” he explained a moment later. “No corruption, no violence. We want leaders who are honest and simple. We want change.”

Rashid, who ran for Parliament in 2013 against Sharif, complained that the family’s campaign is abusing official resources; his brother Shahbaz is Punjab’s top official. “We are fighting the whole provincial establishment,” she said at her clinic, now serving as a call center for volunteers. “But the lion’s roar has become hollow.”

There are half a dozen other candidates, all with slim prospects. But one, a bearded Muslim scholar named Sheikh Yacoob, represents a strategic first foray into electoral politics by the hard-line Islamist movement Jamaat-ud-Dawa. It is led by a controversial cleric, Hafiz Saeed,  who once headed a militant group accused of terrorist attacks in India. He has been under house arrest for months but enjoys public support as a champion of Kashmiri Muslims in India.

Sheikh Yacoob, right, a Muslim scholar from a hard-line Islamic movement, canvasses for votes. (Pam Constable/The Washington Post)

Jamaat, which has softened its image through humanitarian aid drives, founded a political party last month. It was rejected by election officials, so Yacoob is running as an independent. Posters plastered across NA-120 feature him and the party’s symbol, a power-saving lightbulb.

On Wednesday, he strode through a maze of alleys, stopping with leaflets at every vegetable stand and bicycle repair shop. Many people welcomed him, often praising Saeed. It was not clear if that sentiment would translate into votes, but even a few thousand could matter in a tight contest between the Sharif and Khan camps.

“People are demanding new leadership. There is a lot of neglect here. There is sewage and contaminated water,” Yacoob, 46, said afterward. He said he opposes terrorism and believes in religious tolerance. “Our policies are about helping people, not making sermons,” he said.

Read more