Millions of Pakistanis voted on Saturday in local government polls seen as a referendum on PM Sharif's Pakistan Muslim League-Nawaz (PMLN) party midway through its term heading a national coalition government in Islamabad.
The opposition, led by international cricket star turned politician Imran Khan, was hoping to build up nation-wide support to challenge PM Sharif at the next general election.
According to unofficial results based on media tallies, the PMLN led with 1001 out of 2,696 seats in the vote. Mr Khan's Pakistan Tehreek-i-Insaaf (PTI) party only won 231 seats while independent candidates won 854 seats.
Pakistan's local polls, the first in 10 years, were held on Saturday in the central province of Punjab, the country's largest and richest, and the southern province of Sindh. The two other provinces, Khyber Pakhtunkhwa in the northwest and Baluchistan in the west, voted earlier this year.
"It is a great moral victory for the PMLN," ruling party leader Uzma Bukhari told Reuters. "The results tell us that we gained more popularity than even in the 2013 election."
Security and the economy have improved under Sharif but the government has failed to tackle corruption or tax dodging by the wealthy, two problems that are starving social services such as schools and hospitals of cash.
Over 20 million people are registered to vote in Punjab and 4.6 million in Sindh. Pakistan has a population of 190 million.
In the local polls held earlier this year, Mr Khan won in Khyber Pakhtunkhwa in May but Mr Sharif and his allies came out on top in Baluchistan in January.
On Saturday, 11 people were killed when rival political parties fired on each other in Sindh, police said. It was not immediately clear which parties were responsible.
Direct elections to local bodies in districts, which are sub-divisions of Pakistan's provinces, were last held in 2005 under General Pervez Musharraf, who came to power in a bloodless coup.
National and provincial political parties dislike the system, saying the military has previously used it to undermine parliamentary democracy.