Further complicating the matter, while the Japanese had surrendered in mid-August, the Allied forces did not reach the Dutch East Indies until September 29. The power vacuum between the close of the war and the arrival of Allied troops had given Indonesian nationalists ample time to assume control and they declared independence on August 17, with Sukarno as president. The situation in Indonesia was chaotic and rebel groups, many of them trained militarily by the Japanese, had begun attacking prisoners, mostly Dutch.