58-year-old Kayani, who was to retire on November 29 this year, will continue in the key post till 2013.
He had succeeded Gen Pervez Musharraf as the country's 14th army chief in November 2007. The announcement was made by Prime Minister Yusuf Raza Gilani in a televised address to the nation, who said Kayani is being given an extension to ensure continuity in the military operations against extremists and terrorists.
Gilani said the decision to extend Kayani's term was taken after consultations with President Asif Ali Zardari.
"The government is presently engaged in war against terrorism which is now in a critical stage," Gilani said in his address and added that this requires continuity of military leadership under the present Army chief "who led successful operations in Swat, Malakand and South Waziristan."
There have been wide-spread reports in the past few months that Kayani could be given an extension or made the Chief of Defence Staff so that he can continue to guide Pakistan's powerful armed forces in the war against terrorism.
Gilani had last week said that he will make a final decision on whether to give Kayani an extension in service.
Under the 18th constitutional amendment, it is the Prime Minister's prerogative to decide on the term of the Army Chief.
Political commentators feel that Kayani, who has served at various levels of command including as the ISI chief, may have played a pivotal role in the script going wrong during the July 15 Indo-Pak Foreign Ministers-level meeting.
External Affairs Minister S M Krishna and his Pakistani counterpart Shah Mahmood Qureshi were said to have made good progress during their first session on Thursday last.
Krishna was to meet in the afternoon, but there was an inexplicable last-minute switch in schedule under which he met President Asif Ali Zardari before the Prime Minister.
In the time slot Krishna was to meet Gilani, Kayani met the Prime Minister. Kayani had also met Zardari. However, when the Krishna-Qureshi talks resumed after Krishna's two call-ons, the atmosphere totally changed and Pakistan took an unexpectedly stringent posture leading to the deadlock at the talks.
Kayani, who belongs to the Gakhars tribe, was born in Manghot village, a suburb of the garrison city of Rawalpindi, was considered close to former military ruler Musharraf. Kayani had also served as deputy military secretary during the first stint of Benazir Bhutto as Prime Minister in the 1980s.
Image: Pakistan Army chief General Ashfaq Parvez Kayani