[2][4] After that he studied at Corps Opleiding Voor Reserve Officieren (CORO), Magelang and pendidikan artileri, Malang.
[3] After the Indonesian Declaration of Independence, he established the People's Security Army, the forerunner of the military of Indonesia, for the Lesser Sunda Islands.
He then left for the republican capital Yogyakarta to receive orders, before returning to Bali to oppose the approximately 2,000 Dutch troops who had landed on 2 and 3 March 1946.
[4] Ngurah Rai found that the republican forces were divided and he worked hard to reunite them.
On 20 November 1946, the Dutch launched a large attack on Marga with the assistance of troops from Lombok and supported by aircraft.