Pakistani forces launched two raids on Pakistani Taliban hideouts near the Afghan border over the past two days, sparking intense fighting that left 12 soldiers and 35 terrorists dead, the army said Saturday.

The death toll underscores the struggles Pakistan faces as it tries to rein in resurging terrorist groups. The military said 22 terrorists were killed in the first raid in Bajaur, a district in northwestern Khyber Pakhtunkhwa province.

Thirteen more were killed in a separate operation in South Waziristan district, the military said. The statement said that the 12 soldiers, "having fought gallantly, paid the ultimate sacrifice and embraced martyrdom" in South Waziristan.

The terrorists are using Afghan soil to stage attacks in Pakistan, the military said, urging the Taliban government in Kabul "to uphold its responsibilities and deny use of its soil for terrorist activities against Pakistan."

The military described the killed terrorists as "Khwarij," a term the government uses for the Pakistani Taliban, and alleged they were backed by India though it offered no evidence for the allegation. Pakistan has long accused India of supporting the Pakistani Taliban and separatists in Baluchistan, charges that New Delhi denies.