Image copyright EPA Image caption It is the deadliest militant attack in Pakistan since 2014

A suicide bomber has killed at least 128 people at a campaign rally in south-western Pakistan - the deadliest attack in the country since 2014.

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

Earlier, a bomb attack on a similar rally in the northern town of Bannu killed four people. The attacks come ahead of general elections on 25 July.

Meanwhile, former PM Nawaz Sharif was arrested after flying home from the UK.

Sharif and his daughter Maryam were taken into custody by officials from the National Accountability Bureau (NAB) after landing in the northern city of Lahore. They were then put on a chartered plane bound for Pakistan's capital Islamabad.

They were later transferred to a local prison.

The three-term PM was ousted last year after a corruption investigation. Last week he was sentenced in absentia to 10 years in prison.

He has accused Pakistan's powerful security establishment of conspiring against him ahead of the elections.

What is known about Friday's attacks?

More than 150 people were injured in Mastung, officials say.

Image copyright AFP Image caption The bomb was detonated inside a crowded compound in Mastung

Among those killed was Baluchistan provincial assembly candidate Siraj Raisani, his family said. He was a candidate for the Balochistan Awami party.

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

"Human remains and red bloody pieces of flesh were littered everywhere in the compound," local journalist Attah Ullah was quoted as saying by the AFP news agency.

"Injured people were crying in pain and fear," the journalist said.

IS militants later used their news outlet to claim the group carried out the attack.

IS 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 bombing was the deadliest attack since militants from the Pakistani Taliban assaulted an army-run school in Peshawar in December 2014, killing 141 people, 132 of them children.

Earlier in the day, a campaign convoy of another candidate was attacked in Bannu.

Akram Khan Durrani, who represents the MMA party, was unhurt, officials say.

No group has so far claimed responsibility for that attack.

Secular parties targeted

By BBC's M Ilyas Khan in Islamabad

These attacks are unexpected as they come amid claims by the army that militants have been cleared from Pakistan's western regions on the Afghan border, which have become a sanctuary for the Taliban.

Before the 2013 elections, militants had issued early warnings, resulting in a muted campaign by targeted secular parties. Those parties lost the poll by wide margins.

Those same parties and groups appear to be targets again.

These latest attacks may also trigger a new set of tensions ahead of an election already marred by controversy.

Significantly, the attacks come in the aftermath of the conviction of former Prime Minister Nawaz Sharif by an anti-corruption court.

Friday's attacks came just hours before Sharif flew in from the UK to Lahore, and the city is under a lockdown ordered by authorities to prevent his supporters from staging a huge welcome for him.

On Tuesday, a suicide bomber hit a campaign gathering in the northern city of Peshawar, killing 22 people - including a provincial candidate.

The Pakistani Taliban said it had carried out that attack.

What about Sharif's return?

Tensions across Pakistan have been rising ahead of the former prime minister's arrival in Lahore.

Clashes are reported to have broken out between Sharif supporters and security forces at the main highway entry-point to the city.

Image copyright Reuters Image caption Nawaz Sharif has been arrested after flying home from the UK

Thousands of police officers were earlier deployed and shipping containers placed on some main roads.

On Thursday, Sharif's PML-N party said hundreds of activists in Lahore had been detained ahead of Sharif's return.

Sharif's lawyers hope that his return to Pakistan will enable him to file an appeal against his conviction.

Pakistan's general election