At least 23 soldiers have been killed and dozens injured in Pakistan after militants attacked a police compound. The attack took place in the early hours when a vehicle containing explosives rammed into the building in Khyber Pakhtunkhwa province, near the Afghan border. A militant group affiliated to the Pakistani Taliban has claimed responsibility for Tuesday's attack. The compound was being used as a base camp for the Pakistani army. Ahead of the vehicle ramming, several militants attempted to enter the compound in the Dera Ismail Khan district but failed, the army said in a statement. The group then used an explosive-laden truck to ram into the compound's boundary wall, which was followed by a suicide bomb attack which caused the building to collapse, the statement added. There are concerns that the ammunition stored inside the compound in the Dera Ismail Khan district might have also exploded. An official said many people were killed while they were sleeping. Six attackers were killed, the military said. It added that a total of 27 militants were killed following military operations in the area overnight. Pakistan's caretaker Prime Minister Anwaar ul-Haq Kakar and caretaker Interior Minister Sarfraz Bugti condemned the attack. The Tahreek-e-Jihad Pakistan (TJP), which emerged earlier this year, said its members carried out Tuesday's attack. Attacks by militant groups in Pakistan have been on the rise, particularly in its border regions with Afghanistan, after the hard-line Islamist militant group Tehrik-i-Taliban Pakistan (TTP) withdrew from a ceasefire last year. Experts say the TTP have been emboldened by the Afghan Taliban, following the group's return to power in neighbouring Afghanistan in 2021. Islamabad has claimed that insurgents operate from areas across the border. The Taliban in Afghanistan has repeatedly denied this. The TTP, or Pakistan Taliban group, has been fighting the country's armed forces and police for years. The group shares the same hard-line ideology as the Afghan Taliban but is separate from it. At least 100 people were killed in a bomb blast at a mosque in the city of Peshawar in January. At the time, the TTP denied it carried out the attack, instead blaming it on a commander of a breakaway faction. — BBC