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.

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.

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.