ISLAMABAD — Pakistan has foiled a bid by the Islamic State group to expand its network into this predominantly Muslim country, with the military arresting 309 suspects, including IS members from Syria, Iraq and Afghanistan, a military spokesman said Thursday.

The remarks by Lt. Gen. Asim Saleem Bajwa were a rare admission of IS presence in Pakistan, where officials have long insisted that the extremist group has no footprint. Earlier, Pakistani officials had insisted that IS has no presence in the country.

Bajwa told reporters at a press conference in the capital, Islamabad, that among those arrested were 25 foreigners — all from countries where the Sunni militant group has an established presence.

He did not provide details of when and where the arrests were made but he said they came during military operations. Pakistan had stepped up military operations across the country — and specifically in the northwestern tribal regions bordering Afghanistan — after the 2014 Taliban attack on a school in Peshawar that killed 156 people, mostly children.

The suspects had planned attacks on diplomats in Pakistan as well as Pakistani officials, Bajwa said.

The Islamic State group “tried to make an ingress” into Pakistan, but “they failed,” he added. Pakistan is also taking steps to strengthen border control with Afghanistan to prevent militants from entering the country from Pakistan’s war-torn neighbor.

Since launching military operations in the North Waziristan and Khyber tribal regions in 2014, Pakistan has killed 3,500 militants and lost over 500 soldiers, Bajwa added.

Also Thursday, Pakistan reopened the key Chaman border crossing with Afghanistan, nearly two weeks after it was closed in response to Afghan protesters burning the Pakistani flag at a border rally.

Bajwa said the border was reopened after Afghan officials apologized for the incident. He also said Pakistani security forces on Thursday arrested six militants, including two al-Qaida operatives, in Faisalabad, a city in Punjab province.