Praying for Maj Gen Sanaullah Khan and two other soldiers killed in an IED blast by the Pakistani Taliban, Kayani paid rich tribute to them during a visit to Swat, a military statement said.
He said the army would continue to play a role in rebuilding the restive area and assist in maintaining law and order.
Recounting the success of the 2009 military operation in Swat, Kayani appreciated the troops for successfully evicting militants from Malakand division.
The erstwhile Taliban stronghold of Swat has witnessed a resurgence of militant activity since last year. Taliban militants shot teenage rights activist Malala Yousufzai in the head last year in an unsuccessful attempt on her life.
Maj Gen Khan was the senior-most army officer to be killed in the region by the Taliban, while dozens of activists and leaders of the secular-leaning Awami National Party have also died in militant attacks.