JAKARTA, Indonesia -- Former Indonesian President Bacharuddin Jusuf Habibie, who allowed democratic reforms and an independence referendum for East Timor following the ouster of dictator Suharto, was buried on Thursday in a state funeral with full military honours.

Thousands of mourners lined the streets of the capital, Jakarta, to watch the motorcade carrying the body of Indonesia's third president to the Kalibata heroes' cemetery. Many called out the name of the man whose presidency was the shortest in modern Indonesian history but was transformative.

President Joko Widodo led the ceremony, attended by more than 700 politicians, government officials, foreign diplomats and public figures, including former presidents Megawati Soekarnoputri and Susilo Bambang Yudhoyono.

"He is a true statesman, an inspirator, a scientist who believes that without love intelligence is dangerous," Widodo said in a farewell speech. "He is truly a role model for all of the nation's children ... surely Indonesia has lost one of its best sons."

Islamic prayers were said, and as his body was lowered, mourners tossed flower petals into his grave, alongside that of his wife of 48 years, Hasri Ainun Habibie, a medical doctor who died in 2010. A military band played a dirge.

Habibie died Wednesday at Jakarta's Gatot Subroto army hospital, where he had been undergoing treatment for heart problems since Sept. 1. He was 83.

The government has declared three days of national mourning.

Foreign leaders and diplomats offered their condolences, including the U.S. and British ambassadors in Jakarta.

Singapore Senior Minister Teo Chee Hean paid his respects after arriving in Jakarta for a working visit on Wednesday. He wrote on Facebook that Habibie will be remembered for leading Indonesia during a difficult period.

"My deepest condolences to the family and the people of Indonesia," Malaysian Prime Minister Mahathir Mohammad wrote late Wednesday on Twitter. "Truly his death was a great loss."

Australian Prime Minister Scott Morrison said on Twitter early Thursday: "He led the Republic of Indonesia at a time of massive change. His courage and vision during the period of reformation were appreciated in Australia."

Habibie was vice-president when he was tapped to lead Indonesia by Suharto as the military dictator's 32-year hold on power crumbled in May 1998 during a student uprising and a devastating economic crash. It ended after only 17 months in October 1999 when he withdrew from contention in presidential elections.

An engineer educated in Indonesia and Germany, Habibie spent nearly two decades working for German aircraft maker Messerschmitt-Boelkow-Blohm, rising to the position of vice-president and director of applied technology when Suhato convinced him to return to Indonesia in 1974 to help lead a campaign to industrialize the economy.

Habibie became the science and technology minister and used his proximity to Suharto to pursue pet projects, including a state aircraft maker, a steel refinery and various defence-related industries.

"We will always remember your message: don't get into too many discussions, don't be whiny, but immerse yourself into the process of adding value consistently and Indonesia surely will be prominent in Southeast Asia and the world," Widodo said in his farewell speech.

As president, Habibie apologized for past human rights abuses and ordered the release of political prisoners, dismantled restrictions on the press and reformed politics to allow for free elections.

Responding to international criticism of Indonesia's occupation of Portugal's former colony of East Timor, Habibie surprised Indonesians by announcing in January 1999 a plan to hold a referendum under U.N. supervision on self-determination, offering a choice between special autonomy and independence, but East Timorese voted overwhelmingly to split from Indonesia.

"Not only Indonesian people lost him, but we also lost him," East Timor Prime Minister Taur Matan Ruak wrote on Twitter. "He gave us two options and now East Timor is a free and independent nation. Farewell Mr. Habibie."

Despite his reforms, Habibie was unable to master the political tumult unleashed by the student uprising.

A failure to prosecute a longtime friend over allegations of massive corruption undermined his campaign to stay in power. On Oct. 20, 1999, Habibie withdrew from upcoming presidential elections.

Born June 25, 1936, in the South Sulawesi town of Parepare, Habibie was the fourth of eight siblings. His father was of native Sulawesi descent and his mother a Javanese noblewoman from the ancient sultanate of Yogyakarta. Habibie is survived by two sons.