ISLAMABAD (Reuters) - The wife of a Pakistani politician killed in a Taliban suicide attack during campaigning won her husband’s provincial seat in by-elections as the ruling party of new Prime Minister Imran Khan retained its slim majority in parliament.

Samar Bilour on Sunday won the provincial assembly seat in northwestern Khyber Pakthunkhwa province that her husband Haroon Bilour, a member of the anti-Taliban Awani National Party, had been scheduled to contest in July.

Haroon Bilour was killed along with 19 others in a suicide attack in Peshawar, the provincial capital, claimed by the Pakistani Taliban weeks before the July 25 polls. The attack prompted a delay in voting for that seat.

His father, senior ANP leader Bashir Bilour, was killed in a suicide bombing in the run-up to Pakistan’s last election in 2013.

Sunday’s by-elections were for 24 seats across the four provincial assemblies and 11 in the National Assembly. Most of the national parliamentary seats were open because Pakistan allows a candidate to run in multiple constituencies but only keep one seat.

The ruling Pakistan Tehreek-e-Insaf (PTI) won four out of 11 parliamentary seats contested, retaining its slim majority in the National Assembly.

After Sunday’s vote, the PTI and its coalition partners held a slim three-seat majority of 174 seats in the 342-seat parliament. Khan’s ruling coalition in parliament elected him prime minister by 176 votes in August.

But the PTI lost two of the four constituencies originally won by Khan, while former Prime Minister Nawaz Sharif’s opposition Pakistan Muslim League-Nawaz (PML-N) made marginal gains by adding four seats.

The PML-N’s Shahid Khaqan Abbasi, who served as prime minister after Sharif was removed from office by the Supreme Court last year, was among those elected to parliament after missing out in the July elections.

Sharif, who was sentenced to 10 years in prison by an accountability court weeks before the July polls, said the run-up to the elections had been influenced by the military influencing the courts to bar a number of PML-N legislators.

The army and judiciary vehemently deny any interference in civilian politics.