Bacharuddin Jusuf (BJ) Habibie, who has died aged 83, became president of Indonesia by default in 1998 when his patron Suharto could no longer cling on after three decades of dictatorial rule. Though Habibie’s tenure was a mere 512 days, he oversaw a successful if turbulent transition to some form of democracy – though to what extent he actively sought out that goal or was obliged to pursue it through his own weakness and the growing strength of popular protest remains in question.

When he came to power Habibie pledged to lift restrictions on political parties, to recognise “democratic aspirations” and to tackle the “corruption, collusion and nepotism” of the past. On National Day, 17 August 1998, he also apologised for widespread human rights violations under the Suharto regime, admitting that these had been committed by “individuals from the state apparatus”.

Yet he could not fully discard Suharto’s mantle: on the previous day he had presented the nation’s highest award to the dictator’s wife, Raden Ayu Siti Hartinah, and youngest son, Hutomo Mandala Putra (Tommy Suharto), who were both tainted by corruption.

One of Habibie’s most important legacies was his intervention on East Timor (now Timor-Leste), the former Portuguese colony that had been illegally occupied by Indonesia under Suharto in 1975. Habibie initially offered East Timor the special status of “extensive autonomy”, then went further by granting its inhabitants a referendum on self-determination.

Their resounding vote for independence led to brutal suppression by pro-Indonesian militias, and though Habibie wavered during that crisis, he eventually consented to the intervention of a UN peacekeeping force, paving the way for East Timor’s independence.

“Too many people have lost their lives since the beginning of the unrest, lost their homes and security,” he said. “We have to stop the suffering and mourning immediately.” His stance on East Timor was put into effect by the release from jail of the resistance leader Xanana Gusmão, who became East Timor’s first president, and who bid a tearful farewell to Habibie on his death bed.

Indonesian public opinion, however, was not on the side of Timorese independence, and his moves in that direction did not enhance his popularity. A larger domestic grudge against Habibie came from his inability to deal with an inherited economic crisis that led food prices to soar and pushed millions into precarious informal employment. Habibie’s failure to tackle corruption also played a large part in his gradual loss of public and parliamentary support. Several of his associates and leading members of the ruling Golkar party were implicated in the Bank Bali scandal, in which large sums of money disappeared. There was more opposition when his attorney general announced that corruption charges against Suharto would be dropped for “lack of evidence”.

In the run-up to the 1999 presidential elections, a poll in the national Tempo magazine showed that only 7% would vote for Habibie. When Golkar voted him down a month before the elections he had no alternative but to withdraw. His presidential term had not lasted long, but nonetheless he had stayed in office for a greater period of time than many had expected. In his memoirs he observed that “the slightly more optimistic predicted that I would not last more than 100 days”.

Habibie was born in Parepare in the state of South Sulawesi, the fourth of eight children. His father, Alwi Abdul Jalil Habibie, a government official of Sulawesi descent who promoted clove cultivation, died when he was only 12, and his mother, Tuti Marini Puspowardojo, was a Javanese noblewoman from the ancient sultanate of Yogyakarta.

A model plane enthusiast at a young age, Habibie graduated from the Bandung Institute of Technology and continued his studies in Germany. After a doctorate from the Aachen Institute of Technology he joined the aircraft-maker Messerschmitt-Bölkow-Blohm, rising quickly up the management ladder to become vice-president and director of applied technology. In 1974 he was persuaded to return to Indonesia by Suharto, who had seized power in 1967 from the founding president Sukarno after fanning the flames of an anti-left pogrom in 1965-66 in which at least half a million were killed.

Suharto appointed Habibie minister of research and technology, in which role he promoted, not always effectively, investment in a large number of state-owned industries designated as “strategic”, including steel, arms, energy and aircraft manufacture. He deferred to Suharto’s rapacious family, and flattered the dictator by calling him “SGS” – short for Super Genius Suharto.

Early in 1998 Suharto, though faced with economic collapse , sought re-election for a seventh term, and appointed Habibie unexpectedly as his vice-presidential running mate. Suharto’s purpose in doing so became clear when, after victory but with continuing demonstrations against his presidency and a fall-off in support from politicians around him, he resigned shortly after the election, leaving Habibie to succeed him. It may have been a gesture of contempt as much as of confidence: Suharto was one of those who did not expect him to last long.

In retirement Habibie spent much of his time in Germany and wrote a memoir, Decisive Moments (2006), justifying his tenure as president. The Habibie family also invested heavily in Batam Island, across the water from Singapore and a popular tourist destination.

Habibie’s wife, Hasri Ainun (nee Besari), had known him since they were schoolmates. After her death in 2010, Habibie wrote a fond memoir of their life together, Habibie and Ainun, which was turned into a successful film of the same name, released in 2012.

In one popular scene Ainun, a doctor, reproaches him for not taking care of his health: “If you don’t look after your body properly, how are you supposed to look after 200 million people?” she asks.

Habibie did look after the people far better than had his malign patron and predecessor, but with the army still powerful behind the scenes Indonesia’s democratic transition remains incomplete to this day.

He is survived by his two sons, Ilham Akbar and Thareq Kemal.

• Bacharuddin Jusuf Habibie, politician, born 25 June 1936; died 11 September 2019