Deforestation in Indonesia in recent decades has made increasingly large parts of the region vulnerable to fires. Burning is particularly widespread in deforested peatlands, and it leads to globally significant carbon emissions. Here we use satellite-based observations to assess loss and fragmentation of primary forests and associated changes in fire regimes in Sumatra and Kalimantan between 2001 and 2019. We find that fires did not penetrate undisturbed primary forest areas deeper than two kilometres from the forest edge irrespective of drought conditions. However, fire-resistant forest now covers only 3% of peatlands and 4.5% of non-peatlands; the majority of the remaining primary forests are severely fragmented or degraded due to proximity to the forest edge. We conclude that protection and regeneration of the remaining blocks of contiguous primary forest, as well as peatland restoration, are urgently needed to mitigate the impacts of potentially more frequent fire events under future global warming.