Story highlights

Militants were trying to set up an improvised explosive device

The bomb accidentally went off, killed six and injuring five

CNN  — 

Six militants were killed and five others injured as a result of an improvised explosive device explosion in Pakistan’s northwest on Saturday, an official said.

The militants were planting the bomb to attack rival militant groups, but it accidentally exploded, said Ghulam Farooq, a government official of Khyber Agency, one of the seven districts of Pakistan’s volatile tribal region bordering Afghanistan.

The blast happened in the Tirah Valley of Khyber Agency, Farooq said.

Militant groups have been fighting each other in the district for years, he said.

Journalist Amir Iqbal contributed to this report.