(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.