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.

Ngurah Rai found that the republican forces were divided and he worked hard to reunite them.
He then organized the first attack against the Dutch forces headquarters at Tabanan.
The Dutch then attempted to locate Nguraha Rai's base and offered negotiations, which he refused.

On 20 November 1946, the Dutch launched a large attack on Marga with the assistance of troops from Lombok and supported by aircraft.
Lt.
Col Ngurah Rai ordered a Puputan, or fight to the death.
He died along with all of his troops.
The battle is now known as the Battle of Margarana.
However, because Ngurah Rai's entire force was wiped out, including the military leadership, the Dutch forces were subsequently unopposed and were able to regain control of Bali.
This may not have been possible had Ngurah Rai adopted a guerrilla strategy.
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.
Ngurah Rai found that the republican forces were divided and he worked hard to reunite them. He then organized the first attack against the Dutch forces headquarters at Tabanan. The Dutch then attempted to locate Nguraha Rai's base and offered negotiations, which he refused.
On 20 November 1946, the Dutch launched a large attack on Marga with the assistance of troops from Lombok and supported by aircraft. Lt. Col Ngurah Rai ordered a Puputan, or fight to the death. He died along with all of his troops. The battle is now known as the Battle of Margarana.However, because Ngurah Rai's entire force was wiped out, including the military leadership, the Dutch forces were subsequently unopposed and were able to regain control of Bali. This may not have been possible had Ngurah Rai adopted a guerrilla strategy.
I Gusti Ngurah Rai