Lahore, Pakistan - Dismissed Pakistani Prime Minister Nawaz Sharif's wife Kulsoom has won a hotly contested by-election seen as the ruling PML-N party's first key political challenge following the ex-premier's recent removal.

Kulsoom, 66, comfortably defeated the opposition Pakistan Tehreek-e-Insaf (PTI) candidate Yasmin Rashid in the by-election in the eastern city of Lahore, considered the Sharifs' political heartland, on Sunday, unofficial results showed.

Earlier in the day, long lines of voters were seen at many of the NA-120 electoral constituency's 220 polling stations.

Kulsoom was contesting the seat vacated by Nawaz Sharif after his dismissal by the country's Supreme Court in July over an omission in his parliamentary wealth declarations.

Her campaign has been spearheaded by Maryam Nawaz, the couple's daughter and Nawaz' political heir apparent, in her first real foray into electoral politics. Kulsoom herself is undergoing treatment in the UK for her recently diagnosed lymphoma.

My mother has been diagnosed with lymphoma, cancer of lymph nodes, left side of neck in her case. Her treatment begins immediately. — Maryam Nawaz Sharif (@MaryamNSharif) August 23, 2017

Nawaz Sharif and three of his children, including Maryam, are currently facing a corruption investigation and trial by the country's anti-corruption watchdog, on the orders of the Supreme Court.

Delivering a victory speech in her mother's stead, Maryam Nawaz congratulated her party's workers on the win.

"Today, you have not only fought against those who are visible in the battlefield, but also against those who are invisible," she said, a veiled hint at the country's powerful military, which has ruled Pakistan for roughly half of its 70-year history since independence.

She said the by-election result represented a rejection of the Supreme Court's decision by voters.

"The people have given their verdict on the verdict today," she told a roaring crowd of hundreds gathered at the Sharif residence in Lahore.

Standing against Kulsoom was the opposition Pakistan Tehreek-e-Insaf's Yasmin Rashid, a middle-class doctor who has mainly campaigned on the Imran Khan-led party's anti-corruption platform.

READ MORE: Shahid Khaqan Abbasi elected as interim prime minister

The constituency, home to almost half a million of Lahore's 11 million residents, is deep in the heart of the old city and is considered a Sharif stronghold. His party has not lost the seat since it began contesting elections in 1985.

"It's very difficult for them to take this from us," said Sohail Butt, 48, a PML-N voter in the Mozang area of the city. "In our area, work only gets done if you go through [the PML-N's] workers."

Arif Khan, 32, a voter from the working class Bilal Ganj neighbourhood, said he voted for Sharif's party because of its overhaul of the road, sewerage, and water network in his area.

Pakistan Tehreek-e-Insaf (PTI) voters, meanwhile, appeared to be motivated to vote more on national issues, rather than a connection to their party's local networks.

"I see this is as the first main test for Nawaz Sharif [after his dismissal]," said Zeeshan Khan, 22, a student at Punjab University. "This is a way for the people to show whether they still stand with the PML-N after the verdict."

Others echoed that sentiment.

"Our country is on fire, we are all on fire, that is why I am here to vote," said Asifa Aamir, 47, who said she was concerned with corruption as her primary issue in this by-election.

"Work does get done on the local level in the constituency [by the PML-N]," conceded Zeeshan Tariq, 28, a trader from the Mozang area. "But I vote based on the national issues."

Nearby, a few PML-N workers rode by on motorcycles, raising the party's slogan, referencing their electoral symbol of a lion: "Look who's come, it's the lion, it's the lion!"

Workers at a PTI electoral camp office responded good-naturedly with cries of "Thieves! Thieves!"

Not all exchanges on Sunday were as friendly, however, with minor scuffles reported between PML-N and PTI activists off the city's main Mall road.

Extremist 'mainstreaming'

Also contesting Sunday's by-election were two new right-wing religious entrants to electoral politics in Pakistan, the Tehreek Labbaik Pakistan and the Milli Muslim League (MML).

Posters for the Tehreek Labbaik Pakistan, spread across the constituency, have prominently featured images of Mumtaz Qadri, the man who murdered Punjab governor Salmaan Taseer over his criticism of Pakistan's harsh blasphemy laws in 2011.

The MML, meanwhile, is the political wing of the Lashkar-e-Taiba (LeT) armed group, long blamed for suicide and other attacks on targets in neighbouring India and the disputed region of Kashmir.

Early results showed the party was likely to finish third, beating out the Pakistan People's Party (PPP), a major national political party which currently leads the opposition in parliament and rules Sindh province.

The MML shares much of its personnel with the Jamaat-ud-Dawa, a humanitarian relief organisation that the UN and US both designated as a front for LeT, and which faces international anti-terrorist sanctions.

Election banners for MML's candidate, Muhammad Yaqoob Sheikh, prominently featured images of Hafiz Muhammad Saeed, the JuD chief and founder of LeT. Saeed remains under house arrest with no formal charges by Pakistani authorities under an anti-terrorism law.

Saeed is subject to a US bounty of $10m and has been named by both the US and UN as a "terrorist". Sheikh, the MML candidate, was also named as by the US as a "specially designated global terrorist" in 2012, for his alleged role in leading fundraising and operations for LeT.

Neither party is expected to win but could bring in new first-time voters. Analysts say MML is an attempt by Pakistan's powerful intelligence services to bring certain armed groups into the political mainstream to challenge the PML-N's dominance.

"If you give them money, they actually do good work," says Muhammad Naseer, a first-time voter from the Islampura neighbourhood, who voted for the MML. "They are honest. I have donated to JuD and I can see their work."

Asad Hashim is Al Jazeera's digital correspondent in Pakistan. He tweets @AsadHashim