However, under the terms of the surrender agreed with the Allies, the Japanese actually had no right to hand over Indonesia to the Indonesian people. Lord Louis Mountbatten arrived in mid-1945 with several thousand
British troops to accept the surrender of the Japanese occupying force. The Japanese tried to retake towns that they'd previously handed over to the local people and some intense, short-lived battles occurred. The British tried to remain neutral, withdrawing only when the Dutch were in a position to resume control in november 1946.
The war with the Dutch continued for the next three years. But the world was turning against the Dutch campaign, finding their colonial activities anachronistic in the twentieth century. The Dutch finally withdrew in December 1949, and sovereignty was handed over to the new Republic of Indonesia .