PESHAWAR, Pakistan (Reuters) - Pakistan s opposition Tehreek-e-Insaf (PTI) party, led by former cricket hero Imran Khan, swept to a comfortable by-election victory on the edge of the northwestern city of Peshawar, though its majority was trimmed by new hardline religious parties. PTI candidate Arbab Amir Ayub clinched 45,631 votes, about 34.8 percent of the total, on Thursday to ensure PTI kept the parliamentary seat in the province of Khyber Pakhtunkhwa (KP) that it governs.  The by-election was seen as a litmus test of PTI s popularity in KP, where it has focused on police, health and education reforms in contrast to the ruling Pakistan Muslim League-Nawaz (PML-N) party betting on road and energy infrastructure projects. Khan, the PTI chairman, touted the victory as a  direct vote of confidence  in his party s performance governing KP since the 2013 election, when it won the National Assembly seat, known as Peshawar NA-4, with a majority of about 40 percent. The next general election is due in mid-2018 but Khan has called for early polls after PML-N leader and Prime Minister Nawaz Sharif was toppled in July by a Supreme Court disqualification over an undeclared source of income. Analysts say Khan s chances of becoming prime minister have been boosted by Sharif s ouster, and the sportsman has doubled down on his populist message by saying he will pull the country away from infrastructure spending towards improving schools, hospitals and the lives of the poor.  Most of the youngsters like Imran Khan and believe he can steer the country out of crisis and stop corruption,  said Zahid Hussain, a government contractor.    Awami National Party (ANP) candidate Khushdil Khan secured 24,830 votes, or 18.9 percent of the total, to pip PML-N s Nasir Khan Musazai, who won 23,169 votes to finish third. Khushdil Khan s showing will hearten the ANP, whose candidates barely campaigned in 2013 as the Pakistani Taliban targeted and killed many of its leaders and activists in KP. But it was the performance of two new hardline religious parties that caught the eye of political observers.  Muhammad Shafiq Ameeni, a candidate for the Tehreek-i-Labaik party, won 7.6 percent of the ballot campaigning on a platform of support for Pakistan s strict blasphemy laws that are already some of the world s harshest. Labaik supporters have spread their hardline message, including the notion that those who commit blasphemy against Islam should be killed, through mosques and seminaries. Syed Moharram Shah, a Labaik activist, said the party was surprised it captured 9,060 votes because it wasn t fully prepared for the election.  This is our first attempt but look at people s response. It s very much encouraging,  he said. Alhaj Liaqat Ali Khan, an independent candidate backed by the Milli Muslim League (MML) party, loyal to Hafiz Saeed, an Islamist under house arrest, obtained 3,557 votes. Washington accuses Saeed of being the mastermind behind the 2008 attacks in the Indian city of Mumbai that killed 166 people, and has placed a $10 million bounty on his head. Saeed denies the charge. Last month, candidates backed by Labaik and MML won about 11 percent of the ballot in a by-election for Sharif s vacated seat in a by-election in the eastern city of Lahore.  