The war did not end with the withdrawal of the Soviet Army. The Soviet Union left Afghanistan deep in winter, with intimations of panic among Kabul officials. The Afghan mujahideen were poised to attack provincial towns and cities and eventually Kabul, if necessary. General Secretary Mohammed Najibullah's government, though failing to win popular support, territory, or international recognition, was able to remain in power until 1992. Ironically, until demoralized by the defections of its senior officers, the Afghan Army had achieved a level of performance it had never reached under direct Soviet tutelage. Kabul had achieved a stalemate that exposed the mujahideen's weaknesses, political and military. But for nearly three years, while Najibullah's government successfully defended itself against mujahideen attacks, factions within the government had also developed connections with its opponents.