"The terrorist backbone has been broken and Inshaallah we will soon prevail," Kayani said in his address at a passing out parade at the Pakistan Military Academy at Kakul in Khyber-Pakhtunkhwa province.
"Let me assure you that we in the Pakistan Army are fully aware of the internal and external threats to our country. In the war against terrorism, our officers and soldiers have made great sacrifices and have achieved tremendous success," he said.
Kayani's comments came three days after Admiral Mike Mullen, America's top military official, warned that the ISI's longstanding links with the Haqqani militant network are at the core of Pakistan's strained and problematic relations with the United States.
Earlier this month, a White House report had noted that Pakistan's fight against militancy was making little progress.
The report further said that Pakistan had "no clear path to defeating the insurgency ... despite the unprecedented and sustained deployment of over 147,000 forces".
However, Kayani said in his address that the people of Pakistan "value their freedom and independence more than anything else and consider no sacrifice too great to preserve it."
"It is therefore for the people of Pakistan to remain optimistic and keep the dream of a strong and prosperous Pakistan alive. We must never forget that we all owe it to our future generations. I have no doubt that all of us together can achieve it," he said.
"People of Pakistan have the capacity and the will to do it, whatever the difficulties and challenges. Let us revive our promise once again to make Pakistan a strong country worthy of its name and aspiration of its people," he said.
Kayani called on the cadets who passed out of the military academy to fulfil their responsibilities despite the grave dangers and difficulties they would face.