ISLAMABAD Prime Minister Yusuf Raza Gilani, indicted by the Supreme Court on Monday, was once seen as a shrewd operator with the best chance of bringing stability to Pakistan.
The soft-spoken figure tiptoed through Pakistan's political minefields and at times acted as a troubleshooter - charming opposition leaders over tea or a meal to take the heat off the ruling Pakistan People's Party (PPP).
What he lacks in charisma, Gilani has made up for by maintaining close contact with Pakistanis through frequent public appearances and speeches.
But the longest-serving civilian prime minister in Pakistan's turbulent history may be at the end of the line because of his defiance of the Supreme Court, which has become increasingly assertive over the last few years.
He was formally charged with contempt for refusing to ask Swiss authorities to re-open corruption cases against President Asif Ali Zardari. If convicted, Gilani could face up to six months in jail and disqualification from public office.
Rasul Bakhsh Rais, professor at the Lahore University of Management Sciences, said Gilani's politeness and lack of the arrogance typical of other Pakistani politicians has enabled him to reach out to many people, including opponents.
But his support for Zardari, who heads the PPP, landed him in trouble.
"From the start he had a choice whether to be his own prime minister or remain hostage to Zardari's political dramas and he made the wrong choice," said Rais. "In the end his blind loyalty to Zardari and his party cost him."
With the PPP's steady hand gone, Pakistan would face more political chaos that would distract the government from wide-ranging challenges - from a weak economy to a Taliban insurgency.
The government may not fall, but losing the prime minister would be a big embarrassment for the ruling party.
Gilani has lasted for so long partly because he had skillfully steered clear of antagonizing Pakistan's powerful military, which has ruled the country for more than half of its history through a series of coups, or from behind the scenes.
PRESSURE FROM MILITARY
But the prime minister, unanimously elected by parliament in 2008 after the PPP won a general election, crossed a red line this year.
Gilani accused the army and spy chiefs of acting unconstitutionally during a Supreme Court investigation into a mysterious memo that sought U.S. help in reining in the military.
The scandal, which broke last year, created the worst tension between the generals and a civilian government since a 1999 coup and triggered rumors of another military takeover.
Gilani also described the military as a state within a state in a speech in parliament, putting him in the army's crosshairs. He later withdrew his criticism after pressure from the military.
Ironically, when he began his political career in the 1980s he became an ally of then-military ruler Zia-ul-Haq. Later, he joined the PPP and has remained loyal to the party.
Gilani was thrown in jail in 2001 on charges of making illegal appointments from 1993 to 1997 while speaker of the National Assembly during the late Benazir Bhutto's second term as prime minister.
He says the charges were trumped up by former military president Pervez Musharraf's government to pressure him to abandon Bhutto's party, but he refused. He was freed in 2006.
While staying loyal to Bhutto, he sometimes defied her too, earning him accolades as a principled politician, unlike many others who are accused of corruption.
Bhutto's assassination in late 2007 thrust her husband, Zardari, into the centre of the political fray. Gilani would never have become prime minister without Zardari's approval.
Gilani, 59, a member of a prominent Punjabi family, is a journalism graduate from Punjab University.
He wrote a book during his time in jail in which he advocated a strong army but opposed any role for it in politics.
Gilani's forefathers moved from Baghdad to settle in what is now Pakistan. A family member has sat in every assembly since 1921, when Pakistan was part of British-ruled India.
(Editing by John Chalmers and Robert Birsel)