In November 1945, Pandjaitan, together with other young people, helped establish a local branch of the People's Security Army (TKR), initially serving as a battalion commander. In March 1948 he was appointed commander of the commander for organization and education of XI/Banteng Division at Bukittinggi, West Sumatra. Not long after, he became fourth deputy commander (supplies) for the Sumatran Army Command, then when the Dutch launched their Second Police Action against the republic, he was put in charge of supplies for the Emergency Government of the Republic of Indonesia.