Ousted prime minister Nawaz Sharif’s ailing wife on Sunday won the crucial by-election in Lahore that was seen as a test of support for the family after the Supreme Court dismissed Mr. Sharif from the office in the Panama Papers scandal.

Begum Kulsoom won the NA-120 seat in a close contest with cricket-turned-politician Imran Khan’s Pakistan Tehreek-i- Insaf candidate Yasmin Rashid.

The parliamentary seat, said to be a stronghold of the Sharif family, fell vacant after the Supreme court on July 28 disqualified Mr. Sharif in the Panama Papers case on grounds that he was dishonest.

The Election Commission spokesperson said that Ms. Kulsoom bagged 59,413 votes defeating Mr. Rashid with a margin of more than 13,000 votes. Mr. Rashid got 46,145 votes while Sheikh Yaqoob from the Milli Muslim League, a new party backed by Hafiz Saeed-led Jamaat-ut-Dawa (JuD), stood third with more than 4,000 votes.

The support for the Sharif family has, however, diminished as in 2013 general election Mr. Sharif had defeated Mr. Rashid with a margine of more than 41,000.

Ms. Kulsoom recently underwent cancer treatment in London and has been recuperating in the British capital. Her daughter Maryam Nawaz managed her campaign in her absence.

The election to the parliamentary seat was seen as a test for the PML-N party also because it comes ahead of the general election in Pakistan next year.

After the result, Ms. Maryam said people have “dismissed conspiracies” against him. The PML-N leader said the people in the constituency have proven that they love Sharif, adding that now it was the time for “opponents to cry.”

“Thank God million times. This was PML-N vs All. The people have rejected the verdict of the Supreme Court. They have proven that Nawaz Sharif is still their prime minister, regardless of the SC verdict,” she said.

The ruling PML-N blamed the military establishment for picking up around 60 active office-bearers from the seat to influence the by-election.

“During the last two days our active chairmen of union councils and workers of NA-120 have been picked up by those forces who had been active since the ouster of my father. Our party men were taken into custody to influence the outcome of the NA-120 bypoll. But by the grace of God we won despite all the odds,” Ms. Maryam said.

“Our workers were not intimidated by military dictators in the past. They will not be scared off by such tactics today,” she said.

Rashid complained of rigging and said she would not accept the decision till the court decides on “fake” 29,000 votes registered in NA-120.

Federal Railways Minister Saad Rafique told a press conference after the result that the people had rejected disqualification of Sharif and given verdict in his favour. He alleged that many PML-N voters were not allowed to cast their votes.

A total of 44 candidates were in the fray. There were over 320,000 registered voters in the constituency and 220 polling stations.

The Pakistan Army personnel supervised the polling process. The voters’ turnout that was relatively low (less than 30 per cent) in the morning picked up in the afternoon. Long queues were witnessed at several polling stations.

Some voters complained about the delay they had to endure before they could cast their votes and also that their names were missing from the polling list, while others rued inadequate facilities, such as the lack of electricity at the stations.

Minor clashes were reported between PTI and ruling PML-N workers. No one was injured.