In 1978 war broke out between Uganda and Tanzania. The TPDF embarked on a programme of expansion and in January 1979 Lupogo acted as a recruitment officer at the military camp in Makambako. Later that year Tanzania launched an invasion of Uganda. Lupogo, with the rank of brigadier, was given command of the TPDF's 205th Brigade. When Tanzanian commanders feared that a Ugandan regiment was due to attack them from Mubende, they dispatched Lupogo and his brigade north from Masaka to intercept it. The 205th Brigade encountered entrenched Uganda Army troops in the town of Sembabule, marking the beginning of a three-week-long battle. Lupogo deployed his men in small units and attempted repeatedly to dislodge the Ugandans. Their efforts were unsuccessful and Tanzanian morale steadily dropped until TPDF commanders decided to withdraw Lupogo and replace him with Brigadier Muhiddin Kimario. Lupogo transferred command to Kimario while the brigade headquarters was taking fire. Kimario revised the Tanzanians' strategy and the 205th Brigade was eventually able to secure the town. After the fall of Kampala, Lupogo was contacted by one of his former professors from Makerere University about the status of the body of Hans Poppe, a Tanzanian police official who had been killed in a 1971 border clash with Uganda and since kept in a Kampala mortuary. Lupogo helped arrange for Poppe's body to be repatriated.