A bomb exploded near a crowded market in the Pakistani city of Quetta on Saturday, killing at least 15 people, officials said, the latest attack to hit the restive southwestern province of Baluchistan.
Middle East-based Islamic State, which has a branch of loosely affiliated fighters in Afghanistan and Pakistan, claimed the attack shortly afterwards, saying a motorcycle suicide bomber had killed 17 soldiers.
The powerful blast hit as a paramilitary patrol passed by on the road, Baluchistan provincial home minister Sarfraz Bugti said, adding the patrol may have been the target.
"According to the information we have received so far, there are around 15 casualties, people who were martyred, and around 40 people were wounded," Bugti said.
He said a state of emergency had been imposed in the city and all hospitals were on alert.
Quetta's chief of bomb disposal squad, Aslam Tareen, said initial information was that a suicide attacker rammed a motorcycle into a military vehicle.
Pakistan's army press wing said the patrol was the target and there were at least seven civilians among the 15 killed.
It cited army chief General Qamar Javed Bajwa as saying terrorists were trying to disrupt Monday's celebrations of 70 years of independence from Britain.
"Our resolve won't succumb to any challenge," Bajwa was quoted as saying in an official tweet from a top military spokesman.
Separatist militants in Baluchistan have waged a campaign against the central government for decades, demanding a greater share of the gas-rich province's resources.
Taliban and other Islamist militants also operate in the province, which shares borders with Afghanistan and Iran. A U.S. drone strike killed Taliban leader Mullah Akhtar Mansour last year in Baluchistan.
The province was rocked by a series of attacks late last year that claimed over 180 lives and raised concerns about a growing militant presence, including fighters affiliated with Islamic State, which has claimed several bombings in Baluchistan.
A judicial report released after an attack on the province's lawyers left more than 70 dead criticised security provisions in the region and called for increased clampdowns on extremists.
Interviews with Baluchistan police and an internal police report viewed by Reuters described a Baluchistan-based militant network in the province's remote mountainous area of Wadh with 500-1,000 operatives led by a former military asset.
However, military intelligence officials denied the Wadh network exists and the father of the alleged leader says his son is not involved with militants attacking the state.