Image copyright AFP/Getty Image caption Pakistani cricketer-turned politician Imran Khan (c) prays with relatives of a local candidate who was killed

Pakistan is mourning the deaths of 149 people, including nine children, in the country's second deadliest militant attack since its independence.

A suicide bomber hit a campaign rally in Mastung, in the south-western province of Balochistan, on Friday. More than 180 were injured.

A local candidate was among the dead, police say. So-called Islamic State (IS) claimed the attack.

The attack comes ahead of a general election on 25 July.

The poll has been marred by violence and what observers say is a crackdown on political activists, journalists and critics of the powerful military.

Earlier on Friday, a bomb attack on a similar rally in the northern town of Bannu killed at least four people.

Some 70 people are still in hospital following the attacks, government officials said on Sunday.

After Friday's bombings, former Prime Minister Nawaz Sharif was arrested after flying home from the UK.

The three-term prime minister was ousted last year after a corruption investigation. Earlier this month, he was sentenced in absentia to 10 years in prison.

Political leaders observed a day of mourning on Sunday for those killed, including nine children aged between six and 11, and Balochistan provincial assembly candidate Siraj Raisani, who was targeted in the attack.

Historic death toll overshadowed

By BBC's M Ilyas Khan in Islamabad

The death toll in the Mastung attack has risen to one of the highest in Pakistan so far, but it does not seem to have shaken the country the way some previous attacks did.

There are no noisy protests in urban centres, and no exhaustive coverage on television screens.

One reason may be the fact that controversies surrounding the upcoming elections are claiming most attention, and since Balochistan province, where Mastung is located, accounts for just 4% of the country's population, its role in elections is negligible.

Also, Balochistan has traditionally remained one of the most under-reported regions, mainly for two reasons.

First, much of the province is poor rural hinterland, devoid of industry or any major commercial activity. As such, it promises little by way of revenue generation for major media houses to raise their stakes there.

Secondly, a military-enforced media censorship has been in place to deny publicity to an ongoing separatist insurgency in the region, inhibiting the movement of journalists.

Local officials say the Mastung attacker detonated a bomb inside a crowded compound where the campaign rally was being held.

IS, which said through its news outlet it was responsible for the suicide bombing, has carried out a number of attacks in the region bordering Afghanistan in recent years. However, security has improved since the military managed to clear large swathes of territory.

Image copyright EPA Image caption It is the second deadliest militant attack in Pakistan in seven decades

Friday's death toll surpasses that of a 2007 terrorist attack, when former Prime Minister Benazir Bhutto's convoy was targeted and 139 people were killed.

The country's the worst-ever attack is when militants from the Pakistani Taliban assaulted an army-run school in Peshawar in December 2014, killing more than 150 people, most of them children.