Islamabad, Pakistan - The Pakistani military has responded to a charge of having links to armed groups in South Asia, arguing that it is the job of intelligence agencies to maintain such connections, but rejected the notion that Pakistan supported groups such as the Afghan Taliban.

"Please understand, 'having links', and 'supporting' [armed groups] are two different things," said Major General Asif Ghafoor, the military's spokesperson, at a press conference in the northern garrison city of Rawalpindi.

"Name an intelligence agency of any country that does not have links [to armed groups]. Everyone does. If you have the links to finish the threat, then that is a positive contribution."

Ghafoor was responding to comments made on Tuesday by General Joseph Dunford, the US chairman of the Joint Chiefs of Staff, who told the US Senate Armed Services Committee that he believed Pakistan's powerful Inter-Services Intelligence (ISI) agency maintained links to armed groups.

"It is clear to me that the ISI has connections with terrorist groups," he said, referring to groups that are actively engaged in the Afghan conflict, including the Afghan Taliban and the Haqqani Network.

Ghafoor stressed that while the connections may exist, that did not constitute support.

"[US officials] did not say that the ISI is supporting [armed groups]," the Pakistani general said.

Earlier on Thursday, the Pakistani Ministry of Foreign Affairs also denied that Pakistan was supporting armed groups in neighbouring Afghanistan or on its soil.

"We have time and again rejected these allegations. Pakistan has done enough to erase the footprint of terrorism from its soil through indiscriminate counterterrorism operations against all terrorist outfits," said spokesperson Nafees Zakaria at a separate press briefing.

US-Pakistan relations in balance

Dunford's statements came at a particularly sensitive time for Pakistan-US relations, which have been at a crossroads since US President Donald Trump's announcement in August of his country's new Afghanistan and South Asia strategy.

Trump had singled Pakistan out for particular criticism in his policy announcement, saying the country provided safe havens to "agents of chaos, violence and terror", and that the US would be changing how it deals with Afghanistan's eastern neighbour.

"We have been paying Pakistan billions and billions of dollars at the same time they are housing the very terrorists that we are fighting. But that will have to change, and that will change immediately," Trump said at the time.

The policy announcement led to the cancellation of a series of scheduled high-level contacts between US and Pakistani officials.

Pakistan in the crosshairs of Trump's Afghan strategy

Those contacts have since resumed, with Pakistan Prime Minister Shahid Khaqan Abbasi meeting US Vice President Mike Pence on the sidelines of the United Nations General Assembly last month.

Pakistani Foreign Minister Khawaja Asif also met US Secretary of State Rex Tillerson in Washington, DC, on Tuesday to discuss the way forward in the US' implementation of the new strategy.

Speaking after the meeting, Tillerson said he believed the US had a reliable partner in Pakistan.

"This is about the importance of Pakistan, and Pakistan's long-term stability as well," he told reporters. "We have concerns about the future of Pakistan's government too, in terms of them - we want their government to be stable. We want it to be peaceful."

Asad Hashim is Al Jazeera's Web Correspondent in Pakistan. He tweets @AsadHashim.