After the German invasion of the Netherlands in 1940, the government of the Indies began preparing for a possible Japanese invasion. In Langkat, a Home Guard, or "Stadswacht", division was established to defend Tanjung Pura, in Langkat. Amir and his cousin Tengku Harun were in charge; the nobility, trusted by the general populace, was selected to ensure easier recruitment of commoners. When the invasion became a reality in early 1942, Amir was one of the soldiers sent to Medan to defend it. He and the other Dutch-allied forces were quickly captured by the Japanese. He was held as a prisoner of war until 1943, when influence from the Sultan allowed him to be released. Throughout the remainder of the occupation, which lasted until 1945, Amir was employed as a radio commentator and censor in Medan. In his position as prince, he was tasked with helping to collect rice to feed the Japanese occupation army.