LAHORE, Pakistan (Reuters) - Pakistani opposition leader Imran Khan’s party said on Monday it had built momentum in a by-election for ousted Prime Minister Nawaz Sharif’s parliamentary seat, despite finishing second, but the biggest inroads were made by two new Islamist groupings.

Workers of the PMLN political party guide voters and share voting lists outside a polling station in Lahore, Pakistan September 17, 2017. REUTERS/Mohsin Raza

Sharif’s wife Kulsoom won the by-election with 49.3 percent of the vote in the eastern city of Lahore - a handsome margin of victory but down from the 61 percent garnered by the ruling Pakistan Muslim League-Nawaz (PML-N) party in the constituency in an election in 2013.

The vote was seen as a barometer of support for Nawaz in the wake of his disqualification by the Supreme Court in July, and an indication of whether the corruption allegations leveled at the Sharif family have had an impact in their power base in the vast Punjab province. A general election is due next year.

The election commission’s preliminary results released on Monday showed that the candidate of Khan’s Pakistan Tehreek-e-Insaf (PTI) party took 37.6 percent of the vote, up from 35 percent in the last poll.

Shah Mehmood Qureshi, the PTI deputy chairman, said the shrinking of the PML-N’s winning margin from 26 percentage points to about 12 in a constituency where it has been so dominant showed its vulnerability in closer-run races in Punjab in 2018.

“If this happens in one of the strongest constituencies of PML-N, the prime minister’s constituency which they’ve had since 1985 … That means there is a surge for PTI, there is a tilt for PTI,” said Qureshi.

PTI candidate Yasmin Rashid, a gynaecologist from the area, on Monday disputed the count and filed a petition with the electoral commission to suspend the results. “We will continue our struggle for verification of the controversial votes which played an important role in the PML-N victory,” Rashid said.

It was two candidates backed by religious parties that appeared to most chip away at PML-N’s vote share, however, together winning about 11 percent. Neither party - one of which is linked to U.S.-designated terrorist Hafiz Saeed - existed in 2013.

Analysts say the by-election result will certainly concern Sharif’s party.

“The committed and hardline vote did not shift from PML-N, but others who are not hard core or are somewhat independent, they seem to have shifted,” said Hasan Askari, a political analyst.

PTI officials are betting that corruption trials against Nawaz and his family due to start before the next poll, likely in mid-2018, will further erode support for the veteran leader who has served three stints as prime minister.

BARRED FROM OFFICE

Nawaz denies any wrongdoing and his family have alleged a conspiracy led to the Supreme Court disqualifying him for not declaring a small source of income, which he denies receiving.

Nawaz’s daughter Maryam, who spearheaded the campaign as her mother is receiving cancer treatment in London, had framed the by-election as a chance for voters to reject the Supreme Court’s verdict against her father, and late on Sunday suggested some PML-N workers had been threatened and abducted.

Maryam did not name anyone, but PML-N sources said she was accusing elements of the military establishment. The military has not commented on Maryam’s remarks.

PML-N officials tout Kulsoom’s victory as proof that Nawaz remains popular with voters and say the closer margin is largely due to the strong showing by the two candidates backed by religious parties.

One of the surprises of Monday’s official results was the third-place finish of Shaikh Azhar Hussain Rizvi, an independent candidate backed by Tehreek-i-Labaik, a coalition of Islamist groups.

The Labaik-backed candidate won 6 percent of the vote campaigning on a platform of support for Pakistan’s strict blasphemy laws.

His campaign posters praised executed killer Mumtaz Qadri, a bodyguard who assassinated Punjab’s governor for suggesting the laws might be reviewed. After his execution, Qadri was hailed by some religious sects as a martyr for Islam.

Yaqoob Sheikh, who was himself designated a terrorist by the United States in 2012, captured nearly 5 percent of the vote.

Sheikh is backed by the new Milli Muslim League (MML) party that is loyal to Hafiz Saeed, who Washington accuses of being the mastermind behind the 2008 attacks in Mumbai that killed 166 people.

A retired general and analysts have said that the MML - which has yet to be legally recognized, forcing Sheikh to appear on the ballot as an independent - was likely part of a “mainstreaming” project envisioned by the military to draw some militant groups into politics.

The MML on Monday said it planned to contest another by-election in the northwestern city of Peshawar next month.

Despite their relatively strong gains, neither the MML nor the Tehreek-i-Labaik is seen as having much chance of winning many seats in 2018.

(Ths story has been refiled to add dropped word in paragraph 5)