Image copyright Getty Images Image caption Maryam Nawaz (R) led the campaign for her mother Kulsoom (L)

The wife of Pakistan's former prime minister who stepped down over a corruption inquiry has won a key seat in Lahore, unofficial results suggest.

Kulsoom Nawaz stood in place of her husband Nawaz Sharif, who was disqualified from office in July.

She won 61,254 votes, 14,188 more than her nearest rival, local media say.

The vote was seen by both the ruling PML-N party and the opposition as a referendum on the Supreme Court's decision to disqualify Mr Sharif.

Ms Nawaz is currently in London for cancer treatment. Her daughter, Maryam, spearheaded the campaign for the PML-N party in her absence.

"This is not an ordinary victory," Maryam told party supporters after the unofficial results were declared. "You have defeated not only people who were in the field but also those who are invisible."

She said winning her father's former seat in the family's hometown showed that people had rejected the "unjust decision" to disqualify her father.

But, if the results are confirmed, the party's share of the vote in the key constituency has dropped by about 7%.

The Supreme Court barred Mr Sharif from office after an inquiry into the 2016 Panama Papers dump linked his children to offshore companies.

He has always denied the allegations, but the Supreme Court has dismissed petitions seeking a review of its decision.

Media reports suggested a large turnout for the vote on Sunday, with long queues forming outside polling stations.

Image copyright AFP Image caption The military helped to provide security for the by-election

The election was contested by all the major parties, as well as two new Islamist opposition parties.

PML-N faced a strong challenge from the PTI party led by cricketer-turned-politician Imran Khan and the Pakistan People's Party of Bilawal Bhutto Zardari.

The by-election was also seen as a test of support for the Sharif family ahead of next year's general election.

Maryam Nawaz, who does not hold political office but is a high-profile figure in Pakistan, alleged that several PML-N party workers had been threatened ahead of polling day.

She took centre stage in the lead-up to the vote and during the campaign sought to portray it as the "people's verdict" on her father's disqualification.

In a recent BBC interview she said the issue had "galvanised his supporters" and that public sentiment was "very positive".

More than 320,000 voters took part in the poll, which for the first time in Pakistan's history was conducted using Biometric Voter Verification Machines in some the constituency's 220 polling stations, Dawn News reported.