Pakistan's government has become the first in history to complete a full term in office, but a raft of key achievements has been overshadowed by mismanagement, economic decline and worsening security.
When the Pakistan People's Party won elections in 2008 on a wave of national grief over the assassination of its leader Benazir Bhutto few imagined her widower would prove such an adept, agile and long-standing president.
Asif Ali Zardari, the man belittled for years as the ill-educated playboy who spent 11 years in prison over corruption allegations despite never being charged, has managed to achieve what alluded all previous civilian rulers in Pakistan.
For the first time a civilian government has completed a full five-year term in office and will be handing over to another elected government in a country which has seen three bloodless military coups and four military rulers.
Helped by the army chief of staff's determination to keep to the sidelines and the opposition's unwillingness to force early elections, Zardari's wheeler-dealer ability has been crucial to keeping his government together.
Political analyst Jaffer Ahmed, director of the Pakistan Studies department at Karachi University, said Zardari's record has been mixed at best, with his greatest asset the pragmatism needed to stay the course.
"Despite the fact that he has been maligned in corruption, nepotism and numerous other things, he showed patience and perseverance. He successfully withstood pressure from the judiciary and played his cards well and survived," he told AFP.
Parliament has passed more legislation than any of its predecessors.
In 2010, Zardari relinquished much of his power to the prime minister, rolling back on decades of meddling by military rulers in an effort to institutionalise parliamentary democracy.
His government sought to devolve powers to the provinces and introduced reforms that will for the first time allow parties to contest elections in the tribal belt, a den of Taliban and Al-Qaeda militants under only semi-government control.
"Even more significant is parliament's record of enacting a raft of legislation empowering women," said Ali Dayan Hasan, Pakistan director at Human Rights Watch, of measures that include laws against domestic violence and sexual harassment.
But achievements aside, there has been extraordinarily bad governance. Terrorist attacks and insecurity have increased. Shootings and bomb attacks are now a daily reality.
Apart from a watershed military operation that pushed Taliban insurgents out of the Swat valley in 2009, the government has been unable or unwilling to crack down on the plethora of Islamist militant networks blamed for violence in Pakistan, Afghanistan and India.
"Militants appear more defiant and bold in the absence of a clear strategy," said political analyst Hasan Askari.
Pakistan has hosted no international cricket, the national obsession, since gunmen attacked the Sri Lankan team in March 2009. Religious violence has reached dizzying levels with the Shiite Muslim minority bearing the brunt.
Karachi, the largest city and business hub, is suffering from record killings linked to political and ethnic tensions, with more than 2,000 dead in 2012.
Furore over the blasphemy law led to the assassinations of PPP politician Salman Taseer, shot dead by his bodyguard, and minorities minister Shahbaz Bhatti.
Nothing was done to resolve a chronic energy crisis or introduce desperately needed tax reforms. Ministers have been tainted by accusations of appalling corruption.
After the elections, Pakistan is expected to have little option but seek another bailout package from the International Monetary Fund given its yawning budget deficit, estimated by independent experts at seven percent.
Total foreign exchange reserves, including those held by private banks, have dwindled from $13.83 billion in 2008 to $12.56 billion. The rupee has plummeted 60 percent from 61.22 to the dollar on March 24, 2008, to 98 today.
The government was also locked in a damaging power struggle with the judiciary, which in June 2012 sacked the prime minister for refusing to ask Switzerland to reopen corruption cases against Zardari.
In a recent article for Foreign Affairs, Christine Fair, an assistant professor at Georgetown University, warned of the challenges as Pakistan heads into its first democratic transition of power in history.
The next government must consolidate democratic institutionalisation, strengthen civilian control over the military, forge consensus among coalition partners and seek economic reforms against the wishes of itself and its constituents, she said.
"This may prove too Herculean an agenda, especially with the military seeking new ways to assert its own power. Although the government has moved forward by leaps and bounds in the last few years, in other words, progress might be slower in the ones ahead," she wrote.