LAHORE, Pakistan (AP) — Former Pakistani Prime Minister Nawaz Sharif expressed confidence his party would win national elections on Thursday, a vote that has been marred by violence, deep political tensions and the imprisonment of a popular contender.

A day before the election, at least 30 were killed in bombings at political offices, and sporadic attacks on Thursday appeared aimed at disrupting the balloting, including one that killed five police officers in a country beset by surging militancy. A total mobile phone shutdown across the country drew condemnation from rights groups.

The violence, political feuding and a seemingly intractable economic crisis have left many voters disillusioned and raised questions about whether a new government can bring more stability to the troubled Western ally.

But Sharif brushed off suggestions his Pakistan Muslim League party might not win an outright majority in the parliament and would need to form a coalition to govern.

“For God’s sake, don’t mention a coalition government," he said after casting his vote in the upscale Model Town neighborhood of Lahore.

Though there were hours of polling still to go, he even suggested he was thinking about which posts would go to his family members — including his younger brother and former prime minister, Shehbaz Sharif.

“Once this election is over," Nawaz Sharif said, "we will sit down and decide who is PM (prime minister) and who is CM (chief minister)” of Punjab province, a job that is regarded as a stepping stone to becoming premier.

The polls closed Thursday evening, and ballot counting began. Sikandar Sultan Raja, chief election commissioner, said officials would communicate the results to the oversight body by the early hours of Friday, with the outcome released to the public after that.

Deep political divisions make a coalition government seem more likely than Sharif let on. If no single party wins a simple majority, the first-placed gets a chance to form a coalition.

Still, that Sharif appears to be the main contender represents a remarkable reversal of fortunes for the three-time prime minister, who returned to the country last October after four years of self-imposed exile abroad to avoid serving prison sentences. Within weeks of his return, his convictions were overturned, leaving him free to seek a fourth term in office.

His archrival, former Prime Minister Imran Khan, meanwhile, is behind bars and banned from running after a series of convictions, including some just days before the election. Khan was ousted from power in a no-confidence vote in April 2022 and now has more than 150 legal cases hanging over him.

His supporters believe the charges were trumped up as part of an effort to hobble the popular cricket star-turned-Islamist politician, who in his waning days in power began to criticize the country's military, which has long played an outsized role in politics.

Candidates from his Pakistan Tehreek-e-Insaf party have been forced to run as independents after the Supreme Court and Election Commission said they can’t use the party symbol — a cricket bat. In Pakistan, parties use symbols to help illiterate voters find them on the ballots.

Khan is only allowed to watch the state broadcaster PTV in prison and he gets one newspaper a day, the English-language daily Dawn. He planned to watch TV and read the paper on election day, his party said, and his lawyers will brief him when they get the chance to see him.

Political analyst Azim Chaudhry referred to the way Khan's party was treated as “pre-poll rigging.”

“The whole election process seems to be a coronation,” he said.

In the Sharif stronghold of Lahore, there was nonetheless a robust turnout for Khan's party.

In the Ghauri Shahu neighborhood, Kashfa Zain said she left the house at 6:30 a.m. to make sure she was on time to cast her vote for one of Khan’s candidates.

“My kids were impressing on me how important it was to get here early. The kids are making such an effort with this election. They know all about it. They are all voting for PTI,” as Khan's party is known, she said.

Her daughter Ilham, 19, studied the party's policies and figures on Instagram, including which candidates were using which symbols. “They went through it several times,” said Kashfa Zain.

Sharif's supporters, meanwhile, appeared to express less enthusiasm and determination, even in his own constituency. One voter said he had to vote for the family because they were his neighbors and he saw them almost everyday.

“They are good for the economy, they are good for industry," said photographer Shahrukh Bhatti. “They have good controls on foreign exchange. But people are so demoralized about this vote," he said, throwing his hands up as a sign of helplessness.

"It’s being controlled by outside forces," he said, a reference to the country's military, which has ruled Pakistan for more than half of its history and still ultimately decides who comes to power.

The only other real contender is the Pakistan People's Party. It has a power base in the south and is led by a rising star in national politics — Bilawal Bhutto-Zardari, the son of assassinated former Prime Minister Benazir Bhutto.

The Sharifs and Bhutto-Zardari are traditional rivals but have joined forces against Khan in the past. Analysts predict the race will come down to the parties of Nawaz Sharif and Bhutto-Zardari, who is unlikely to secure the premiership on his own, but he could be part of a Sharif-led coalition.

As voters headed to polls, hundreds of thousands of security forces fanned out across the country and authorities suspended mobile phone service to prevent disruptions and flash protests — raising further concerns about the fairness of the vote with people unable to make calls or send text messages.

Rights group Amnesty International condemned the shutdown. “It is reckless to impede access to information as people head out to polling stations on the heels of devastating bomb blasts and what has been an intense crackdown on the opposition in the lead up to the elections,” said Livia Saccardi, interim deputy director for South Asia.

Despite the show of force, there were a handful of attacks.

In the northwest, attackers set off a bomb and then opened fire at a police van, killing five officers, while separately gunmen fired on troops, killing a soldier, officials said. No one immediately claimed responsibility for either attack. On Wednesday, two bombings at separate political offices killed at least 30 people in southwestern Baluchistan province.

Caretaker Prime Minister Anwaar-ul-Haq Kakar congratulated the nation on the elections. Without sharing details, he said turnout was high and that “voices, expressed through the votes, will contribute to the fortification of our democracy."

In Lahore, mother and daughter Risham and Bishmah Ahmer were early arrivals at their polling station. Bishmah Ahmer, a 20-year-old first-time voter and electrical engineering student, said she hoped there wouldn’t be any cheating.

“I want a government that creates more job opportunities. I also want better education and health care systems,” she said.

Her mother was disappointed at the treatment of Khan and his party — but wasn't deterred. “It’s important for us to vote, it’s our responsibility.”

___

Ahmed reported from Islamabad. Associated Press writers Abdul Sattar in Quetta, Pakistan, Riaz Khan in Peshawar, Pakistan, and Asim Tanveer in Multan, Pakistan, and Maamoun Youssef in Cairo contributed to this report.

___

Follow AP's Asia-Pacific coverage at https://apnews.com/hub/asia-pacific

Copyright 2024 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without permission.