Long in failing health, Wahid left an indelible mark on Indonesia as a liberal Muslim cleric who spoke with moral authority and defended the rights of ethnic minorities and the disenfranchised.
He had been receiving treatment in the intensive care unit of a Jakarta hospital for the last week. Doctors said the former president, who had long been confined to a wheelchair, unable to see and suffering kidney problems, died during surgery to remove a blood clot in his heart.
During his political life, Wahid was often unpredictable and outspoken, putting together unlikely political coalitions, changing policies to appease various factions and battling the establishment in the world's fourth-most-populous nation. But he was a wily deal-maker and had the respect of most groups in his diverse nation, from rebellious students and liberals to powerful army generals and former presidents Suharto and B.J. Habibie.
Wahid's power base came from his leadership of the 30-million-member Nahdlatul Ulama, a conservative Muslim organization founded in 1926 by his grandfather, Hasyim Ashari. But Wahid, who said he did not want to turn non-Muslims into second-class citizens, had liberal views on religion that often put him at odds with the Islamic establishment.
Though he had never run for political office before, Wahid was elected president Oct. 20, 1999, by the national assembly in a close vote over Megawati Sukarnoputri, the daughter of Indonesia's first president. Her father, Sukarno, had held the last free election in 1955. In a gesture of reconciliation, Wahid made Megawati his vice president.
Wahid took over a scandal-ridden, corrupt government and a country beset by economic depression, separatist movements in the regions of Aceh and Irian Jaya, and a disgraced military whose widespread human rights abuses had aroused international condemnation.
After nearly five decades of dictatorial rule by Sukarno and Suharto and 17 months of chaotic transition under Habibie, Wahid moved quickly to strengthen civilian control over the military, appointing the first civilian defense minister since independence in 1949. He also took steps to root out corruption and nepotism in the government. Leading by inspiration more than by decree, he was conciliatory and tolerant.
Wahid offered autonomy to the rebellious region of Aceh, set up economic ties with Israel and worked to strengthen relations with China. He reached out to East Timor, whose people had voted in August 1999 to sever links with Indonesia in favor of independence, and scurried through the region looking for funds to support his country's economic recovery.
Wahid had a wry sense of humor but was often perceived as a bumbler in important affairs, and his presidency stumbled. He was impeached by parliament in 2001 over charges of corruption and incompetence and replaced by Megawati.
Affectionately known as Gus Dur, a nickname that combines an honorific title with a shortened form of his name, Abdurrahman Wahid was born Aug. 4, 1940, in East Java. His father, Wahid Hasyim, was a prominent Muslim leader who died in a car accident when Gus Dur was 13 and was honored by a huge turnout at his funeral.
"Seeing all those people weeping and saying goodbye to him like that," he told author V.S. Naipaul years later, "the impression on me was like this: Is there anything greater in life than being loved by so many people?"
In the 1960s, Wahid went abroad to study literature and social sciences at the University of Baghdad in Iraq and Islamic law at Al Azhar University in Cairo. He later studied at the University of Toronto. He returned to Jakarta, the Indonesian capital, in 1974 and began writing a column for Tempo magazine. He was elected chairman of Nahdlatul Ulama in 1984.
His liberalism annoyed Suharto, who ruled for 32 years until forced from power in May 1998 by street protests. And Wahid's willingness to defend human rights peeved the Indonesian military. His accusation that Habibie, Suharto's successor, had appointed five racist, anti-Chinese ministers to the Cabinet in 1998 brought anonymous threats by phone. But Wahid refused to be silenced.
In February 1998, Wahid suffered the first of two strokes and fell into a coma. Brain surgery saved his life but left him nearly blind. Even as president, Wahid assigned four aides to guide him virtually everywhere, and he gave speeches off the cuff because he could not read documents.
A year before his election, he was asked at a conference of Chinese businesspeople how he would like his epitaph to read. Wahid said: "Here lies a humanist."
Lamb is a former Times staff writer.
Times staff writer John M. Glionna in Beijing contributed to this report.