Pakistan's hawkish army chief Gen Ashfaq Parvez Kayani, who did little to change the force's India-centric stance, will leave the world's sixth-largest army grappling with a host of security challenges when he steps down on Friday.
The 61-year-old Kayani, the first spy master to become the army chief, will retire after an extended tenure that saw the Pakistani military launch operations against some terrorist factions while leaving other groups like the anti-India Lashkar-e-Tayiba free to operate on the country's soil.
It was during an interaction with the Pakistani media in February 2010 that Kayani said his force would remain an "India-centric" force till the Kashmir issue and water disputes are resolved.
Though the army did not block the previous Pakistan People's Party-led government's efforts to normalise trade with India, many believe the force had a hand in scuttling the move to give India Most Favoured Nation-status in December last year.
Kayani is retiring after heading the Pakistan army for six years at a time when the country is trying to cope with several security challenge, including a raging Taliban insurgency and the impending drawdown of United States and foreign troops from neighbouring war-torn Afghanistan.
Known as a chain-smoking man of few words, Kayani was once described by the Central Intelligence Agency officials in a 2008 New York Times article as a "master manipulator". His India policy too has been difficult to comprehend, analysts say.
Though it was under Kayani's watch that the Pakistani military made a paradigm shift and described home-grown militancy as the "biggest threat" to national security rather than India, critics say the jihadi tap was never shut off.
Pakistani soil continued to be used for planning and staging terror attacks on India, including the brazen Mumbai 2008 attacks that involved some serving and retired officers of the ISI, which Kayani headed before becoming army chief.
The latest tensions on the Line of Control too were blamed on the Pakistani military's efforts to give a push to the militancy in Jammu and Kashmir by backing infiltration bids by militant groups like the LeT.
However, some in Islamabad argue that Kayani, the son of a non-commissioned officer, was interested in building ties with India and cite the example of his call for demilitarizing the Siachen glacier.
Last year, after an avalanche on the world's highest battlefield buried 124 Pakistani soldiers and 11 civilians, Kayani advocated peaceful coexistence with India and said both countries should pull back their troops from the glacier.
With the Kargil fiasco in mind, the Indian Army insisted on authentication of positions on the Actual Ground Position Line on Siachen before any talk of demilitarisation or withdrawal.
People connected with the security establishment and analysts say Kayani was "hurt" when his proposal on Siachen was not actively pursued by India.
Kayani's policy for fighting the home-grown terrorists that he declared as the biggest threat to Pakistan's security too has been slammed by his detractors.
Though he launched a massive operation against the Taliban in the Swat valley after they advanced to districts located 100 km from Islamabad in 2009, he repeatedly spurned US requests to flush out the Haqqani network and other factions from North Waziristan Agency.
Some have praised Kayani for his efforts to distance the army from politics -- soon after he was named army chief by former President Pervez Musharraf in 2007, he recalled army officers serving in civilian departments - but others point to his role in confronting the government over issues like the Kerry-Lugar Act.
During Kayani's tenure, the army criticised the Kerry-Lugar Act for attaching stringent conditions for military aid from the US. The army also forced the PPP-led government to drop moves to bring the ISI under civilian control and to send the spy agency’s chief to India for helping in the probe into the Mumbai attacks.
Kayani is known to be reclusive and, unlike his predecessor Musharraf, he stayed away from elaborate media interactions. Kayani has been described by many as a soldier with no political aspirations and this was one of the reasons why Musharraf choose him.
He rose after overseeing an investigation into attempts to assassinate Musharraf in December 2003. In his book 'In the Line of Fire', Musharraf writes how the investigations initially ran into problems because of inter-agency rivalries.
"But these disappeared when I appointed Kayani in charge of investigations," he wrote.
Observers believe it was from this time onwards that Musharraf began to rely on Kayani for crisis management and involved him in secret talks with former premier Benazir Bhutto before her return to Pakistan from self-exile in 2007.
While critics question him over the security situation in Pakistan, especially after the embarrassing US military raid that killed Osama bin Laden in Abbottabad in 2011, his admirers say he was the man who facilitated the country's first ever democratic transition of government this year.
An infantry man, Kayani got his start in the Baloch Regiment. He has also undergone training in the US which helped him establish a good rapport with the American military leadership.