JAKARTA, Indonesia — B. J. Habibie , who as president of Indonesia ushered in an era of democracy that ended the brutal and corrupt rule of Suharto, whose 32-year dictatorship was one of the most brutal and corrupt of the 20th century, died on Wednesday at a hospital in Jakarta. He was 83.

His son Thareq Kemal Habibie said the cause was heart failure.

“Please allow me on behalf the Indonesian people, and the government, to convey our deep sorrow,” Indonesia’s president, Joko Widodo, said. “We know Mr. Habibie as a world-class scientist, the father of technology in Indonesia and the third president of the Republic of Indonesia.”

Mr. Habibie was working for the aerospace manufacturer Messerschmitt-Bölkow-Blohm in Germany in 1974 when Suharto persuaded him to return to Indonesia and develop the country’s technology.

He held several posts before Suharto named him to his cabinet as minister of research and technology in 1978. Twenty years later, he appointed him vice president and his successor.