When Indonesia declared itself independent in 1945 the Dutch fought a war to keep the colony. This war was won by the Indonesians. The Dutch government accepted Indonesia's independence in 1949, and the KNIL ceased to exist.