 After the atomic bombings of Hiroshima and Nagasaki and the proclamation of Indonesian independence in August 1945 , the Japanese began withdrawing from the nascent republic . The Indonesian republican government , based in Jakarta and including Sukarno as president and Mohammad Hatta as vice president , began to take over infrastructure from the departing Japanese . By September 1945 , however , allied British and Dutch forces had begun to enter the archipelago , hoping to reestablish the status quo ante . The British initially focused on Java and Sumatra and attempted to avoid armed confrontations with the Republican forces ; the Dutch , meanwhile , spent the first months after the Japanese surrender reclaiming the eastern islands with help from Australia . 
