By Kay Johnson and Asad Hashim

RAWALPINDI, Pakistan (Reuters) - Pakistan's military on Thursday said it has halted Islamic State's attempts to expand there, arresting more than 300 people, including some Syrians, who were involved in plotting attacks on government, diplomatic and civilian targets.

The comments were rare acknowledgment by a senior Pakistani official that Islamic State, mainly based in Syria and Iraq, has had any active presence in a country that is home to myriad militant groups including the Afghan and Pakistan Taliban, al Qaeda and the Haqqani network.

Lieutenant General Asim Bajwa, the military's top spokesman, also rejected U.S. complaints that it was not acting against the Haqqani network, suspected of carrying out suicide bomb attacks in Kabul, saying Pakistan was pursuing an "indiscriminate operation" against all militants.

Pakistani authorities have so far arrested 309 people associated with Islamic State (IS) on its territory, he said.

Some were involved in assaults on the media, including grenade attacks on local television outlets ARY TV News and Din News in the last year in which five people were wounded.

Other attacks were also planned on a variety of targets, he added.

"They tried to make an ingress, and they failed and they have been apprehended so far," Bajwa said.

Most of those captured by Pakistan were established Pakistani jihadists who had switched loyalties to Islamic State's self-proclaimed worldwide caliphate, but about 25 were foreigners including Afghans and some Syrians, he said.

Bajwa said that of a core group of 20 organizers, "we have captured all of them, except for one who I am sure is not in Pakistan".

He said IS fighters were still present in the Afghan provinces of Nangarhar, Khost and Kunar, which lie along the border with Pakistan.

The movement's leader for Afghanistan and Pakistan, Hafiz Saeed Khan, was killed last month by a U.S. drone strike in eastern Afghanistan.

International concern that Islamic State was establishing an operational presence in Pakistan increased after the group said it carried out a suicide bombing at a hospital in the city of Quetta that killed more than 70 people.

However, a breakaway faction of the Pakistani Taliban also claimed the hospital bombing and Bajwa said he believed the Islamic State statement was false.

"We haven't got any evidence of involvement by Daesh. I think this was just an attempt to glorify themselves," he said, using the name by which IS is also known.

"NO GOOD OR BAD TALIBAN"

The military spokesman also dismissed U.S. concerns that Pakistan has been selectively targeting militant groups on its soil.

"There is no concept of good or bad Taliban," he said.

"Terrorists of all organizations, including Haqqanis, including Afghan Taliban, have been killed and some apprehended ... so if you say that you know actions have not been taken or (are) not being taken, that is wrong."

He spoke a day after U.S. Secretary of State John Kerry urged Islamabad to push harder against militants hiding within its borders.

The United States has criticized Pakistan for not acting against those groups, and last month it refused to release $300 million in military disbursements for that reason.

Critics say Pakistan has targeted only militants who attack its own state, not those active in neighboring Afghanistan and India.

Pakistan has been fighting the Tehreek-e-Taliban Pakistan (TTP), an umbrella group fighting to impose strict Islamic law in Pakistan, since 2007.

It is also home to other armed groups, such as the Haqqani network and Afghan Taliban, who fight international forces in neighboring Afghanistan.

Bajwa criticized international and local security forces in Afghanistan for not sealing the border when the Pakistan army began the latest phase of its military offensive against Pakistan-based militants in July 2014.

"Before the operation started, Pakistan had informed all stakeholders at all levels, political, diplomatic, military ... We told them that you will have to take action ... and that did not happen unfortunately," he said.

He also released rare figures on progress in its anti-militant operation, saying more than 3,500 had been killed. He added that 516 soldiers had also been killed.

It is difficult to verify those figures independently, as access to the conflict zone is heavily restricted.

"We have paid $106.9 billion (on) this war ... If anyone points a finger at Pakistan or casts an eye of suspicion on Pakistan, they need to know this cost," said Bajwa.

(Editing by Mike Collett-White)