in december 1979, the soviet union sent around 100,000 troops to the democratic republic of afghanistan to assist the pdpa government against a nationwide mujahideen insurgency. the mujahideen were made up of various groups that were trained by pakistan and the west. in the wake of the iranian revolution and the soviet invasion of afghanistan, the iranian consulate in afghanistan closed, as did the afghan consulate in iran. relations between afghanistan and iran quickly deteriorated even more. in 1985, iran urged afghan shia groups to unite and oppose the government of afghanistan. iran supported the mujahideen rebels and provided various types of assistances to them who pledged loyalty to the iranian revolution. in the meantime, over a million afghan refugees were allowed to enter iran.