Following the outbreak of hostilities with Uganda in November 1978, Sokoine ordered Tanzania's regional commissioners to marshal all military and civilian resources for war. On 23 January 1979 he toured the Ugandan town of Mutukula following its capture by Tanzanian forces. In April 1979 Sokoine went to Nairobi and met with Kenyan President Daniel arap Moi. He attempted to convince Moi to halt the flow of Libyan military aid through the country to Uganda, but was rebuffed. Tanzania eventually won the war. Sokoine joined Nyerere and other high officials on 26 July 1979 at Kaboya Military Cemetery in Muleba District to pay their respects to Tanzania's dead soldiers. Sokoine had gone many days without sleep during the conflict and was left in ill health by its end. Tanzania also entered a post-war economic recession. In 1980 Sokoine offered his resignation to Nyerere and left the premiership.