After the Proclamation of Indonesian Independence, Kawilarang returned to Jakarta and enlisted in the newly formed Indonesian army. In October 1945, he was assigned to the staff of the First Command of West Java or "Komandemen I Jawa Barat" in Purwakarta and given the rank of Major. In January 1946, he became Chief of Staff of the Bogor Infantry Regiment of the Second Division. In August 1946, he became the commander of the Second Brigade ("Surya Kencana") of the newly formed Siliwangi Division and was promoted to Lieutenant Colonel. He was in command of the brigade during Operation Product, which was the first Dutch military aggression against the Republic of Indonesia. He also commanded the First Brigade for a brief period when the brigade was transferred to Yogyakarta.