The Soviet invasion of Afghanistan in 1979 created for Pakistan a real security threat on the western borders for the first time in its history. As a result, two new corps were raised to guard the western borders. These were the XI Corps in Peshawar, and the XII Corps, with the responsibility of guarding the Bolan Pass. The formation spent, the first few years of its history guarding against Soviet expansionism. The end of the cold war and the ending of the Soviet threat, led the formation into a new era. It would lose divisions, and brigades to the western border. Notably 40 infantry division would be moved to Okara, and for a time it would have only one division.