Informal negotiations for a Soviet withdrawal from Afghanistan had been underway since 1982. In 1988, the governments of Pakistan and Afghanistan, with the United States and Soviet Union serving as guarantors, signed an agreement settling the major differences between them known as the Geneva Accords. The United Nations set up a special Mission to oversee the process. In this way, Najibullah had stabilized his political position enough to begin matching Moscow's moves toward withdrawal. On July 20, 1987, the withdrawal of Soviet troops from the country was announced. The withdrawal of Soviet forces was planned out by Lt. Gen. Boris Gromov, who, at the time, was the commander of the 40th Army.