LAHORE, Pakistan (AP) — The former prime minister of Pakistan expected his party would claim an easy victory in the country’s parliamentary elections, sending him to the top job for a fourth time. Instead, Nawaz Sharif faces a difficult path to power.

Independent candidates backed by his imprisoned rival, Imran Khan, were leading in the vote count Friday, a surprisingly strong showing given assertions by Khan’s supporters and a national rights body that the balloting was manipulated to favor Sharif.

That scrambled the plans of Sharif — and the security establishment backing him — forcing him to announce plans Friday to try to form a coalition government.

A day earlier, Sharif had gruffly rejected the idea of a coalition, confidently telling reporters after casting his vote that he wanted a single party running Pakistan for a full five-year term.