The president conveyed his profound grief through his official twitter account he upload at 1.39 p.m on Sunday.
"(We conveyed our) deep grief to the Government and people of Cuba over the death of Fidel Castro, the former Cuban president on Saturday, November 26, 2016 -Jkw," the president wrote on his twitter account.
Fidel Castro, who retired from politics in 2008, died at the age of 90 years.
Castro has previously handed over power to his younger brother, Raul Castro, in 2006.
News on the death of Fidel Castro was announced officially by his younger brother.
"The Commander of the Cuban revolution has died at 22:29 Tonight," said the President of Cuba, Raul Castro, a moment after the death of his brother.
Fidel Castro led Cuba for almost 50 years before Raul took over his position in 2008.
Earlier, the Indonesian government, through the Ministry of Foreign Affairs, offered condolences to the people and Government of Cuba in the wake of the death of Fidel Castro.
"May he rest in peace," the ministry of foreign affairs spokesperson Arrmanatha Nasir said here on Sunday.
The Foreign Affairs Ministry released a statement on Sunday after Cuba officially announced that Fidel Castro had died at age 90.
Castro has been in poor health since an intestinal ailment nearly killed him in 2006.
Nasir said Indonesia grieved over the loss of Castro and prayed that his family, government, and people of Cuba would be given strength on the passing of Castro.
Fidel Castro took power in a 1959 revolution and ruled Cuba for 49 years with a mix of charisma and iron will, creating a one-party state and becoming a central figure in the Cold War.
He was demonized by the United States and its allies but admired by many leftists around the world, especially socialist revolutionaries in Latin America and Africa.
Indonesia and Cuba established the diplomatic relations in 1962 and Indonesia opened its Embassy in Havana in 1963.
Since then, Indonesia and Cuba have enjoyed good relations both in bilateral and multilateral cooperation, particularly in South-South cooperation.
Indonesia also welcomed the re-establishment of the ties between Cuba and the US on July 20, 2015.
As a country which has good relations with Cuba and the US, Indonesia hoped that the normalization of relations between the two countries will promote peace in the region and the world.