Former Indonesian leader Abdurrahman Wahid, a Muslim cleric who served as the country's fourth president after years in opposition to strongman President Suharto, died in hospital on Wednesday at the age of 69, Reuters reported.
Wahid, usually known as Gus Dur, was president between 1999 and 2001 after taking office on a wave of optimism in the turmoil following Suharto's fall from power.
"He passed away this afternoon," said his aide Sulaiman, who added that his family was at his bedside at the time and current President Susilo Bambang Yudhoyono was also there.
The head of the Cipto Mangunkusumo hospital in central Jakarta said that his condition had been improving until Tuesday, but he was later transferred to intensive care after problems with his respiratory system and blood vessels.
Yudhoyono later said that Wahid would be given a state funeral in Jombang, East Java, on Thursday.
"I ask all Indonesian people to fly flags at half mast for a week as an expression of our deepest condolence," Yudhoyono said in a televised address.
The jocular cleric became the first Indonesian to win a contested presidential vote in October 1999, edging out Megawati Sukarnoputri, the daughter of founding President Sukarno.
But when he assumed the highest office in the world's fourth most populous country he struggled to deal with the broken economy and an unstable and fragmented political system in need of a strong leader and good manager.
His style was often perceived as bumbling and chaotic, and any hope that his penchant for jokes, formidable intellect and political skills would help lead Indonesia through the transition from authoritarian rule to democracy quickly fell flat.
Wahid's presidency ultimately collapsed amid moves to declare a state of emergency when faced with impeachment over allegations of corruption and incompetence, and he was sacked by parliament and replaced by Megawati.
Wahid suffered several strokes, was nearly blind and had diabetes and regular kidney dialysis, but despite his frail health he remained an influential figure in politics.
He was a staunch defender of moderate Islam and secular politics and was the former leader of Nahdlatul Ulama, a Muslim group with some 40 million members.
He also regularly spoke up for the rights of minorities in the world's most populous Muslim nation.
The former president's body was carried through a throng of people in the lobby of the hospital in a coffin wrapped in green, the traditional color of Islam, to a waiting car to be taken to the family home in Jakarta.