Verdict seen as a blow to the government, which had attempted to change the process for elections scheduled this week.
Islamabad, Pakistan – Vote counting is under way in Pakistan’s federal and provincial assemblies for 37 seats in the upper house of parliament, following a hotly contested campaign between the ruling Pakistan Tehreek-e-Insaf (PTI), its allies and several opposition parties.
Prime Minister Imran Khan was among dozens of legislators who cast their votes at the National Assembly, the lower house of parliament, in the capital Islamabad on Wednesday.
Parliament’s upper house, the Senate, consists of 96 members, of whom half are elected for staggered six-year terms.
The election will see legislators in four provincial assemblies elect senators to represent their provinces, and the National Assembly electing a Senator to represent the capital, Islamabad.
There is a sharp focus on the race for the Senate seat being fought in the National Assembly, where Finance Minister Abdul Hafeez Sheikh is standing against the opposition’s candidate, former Prime Minister Yousuf Raza Gilani.
Voting is not being held in Punjab, the country’s largest province, as all 11 vacant seats from there were won by candidates who stood uncontested, following negotiations between Khan’s PTI and opposition parties.
Five seats each in that province have been won by the PTI and the Pakistan Muslim League’s Nawaz faction (PML-N), one of the main opposition parties.
The remaining seat was won by the Pakistan Muslim League’s Quaid faction (PML-Q), an ally of Khan’s government.
The election is being held by secret ballot after the country’s Supreme Court on Monday ruled that a government move to require voting be done through open and public ballots was unconstitutional.
Khan’s party has long called for reform in the complicated process of electing senators, which has been marred by allegations in the past that the secret ballot allows legislators to vote against party lines in exchange for bribes.
In 2018, the PTI expelled 20 members it said had violated the party’s voting policy and engaged in corrupt practices in the Senate polls held in March that year.
The opposition, led by the PML-N and the Pakistan People’s Party (PPP), has defended the secret balloting process, arguing it allows the legislators to vote according to their conscience rather than fearing retribution from their parties if they vote against party lines.
If the legislators in the current polls vote along party lines and voting policy on alliances, the governing PTI is expected to emerge as the largest single party in the upper house.
It is however unclear if the party will be able to gain the numbers required to control the house alongside its allies.
Unofficial results are expected to be announced by the Election Commission of Pakistan later on Wednesday.
Asad Hashim is Al Jazeera’s digital correspondent in Pakistan. He tweets @AsadHashim