A moving video showing an ex-guerrilla leader embracing a former president prior to his death has gone viral in Indonesia.

Xanana Gusmao led an armed rebellion against Indonesia’s occupation of East Timor for two decades and was released from prison months before an independence referendum in 1999.

The president who granted that referendum was BJ Habibie, who died on Wednesday at the age of 83. He is remembered for guiding Indonesia to democracy after the fall of the dictator Suharto.

Mr Gusmao became East Timor’s first president after independence in 2002.