ISLAMABAD, Pakistan — Gunmen in the southwestern province of Baluchistan attacked a bus carrying Shiite pilgrims to Iran on Tuesday, killing at least 25 people and wounding 6 more, local police officials said.

The bus driver said that 8 to 10 attackers ordered the pilgrims off the bus and opened fire on them, the police said.

Hours later, the extremist Sunni group Lashkar-e-Jangvi claimed responsibility for the attack. The group, which the authorities say carried out previous attacks against Shiites in Baluchistan, is believed to be affiliated with Al Qaeda.

The attack occurred at Mastung, about 30 miles south of Quetta, the provincial capital, along the road to the Iran-Pakistan border crossing at Taftan. About 50 passengers were on the bus when it was attacked, said Saeed Imrani, the local deputy police commissioner.