Salahi was an exceptional student in high school in Mauritania. In 1988, he received a scholarship from the Carl Duisberg Society to study in West Germany, where he earned an electrical engineering degree from the University of Duisburg. In 1991, Salahi travelled to Afghanistan to join the Mujahideen fighting against the communist central government. The United States had supported the Mujahideen against the Soviet occupation starting in 1979, and funnelled billions of dollars of weapons and aid to the "freedom fighters". After the Soviet withdrawal in 1989, there was a civil war between Mohammad Najibullah's government and the Mujahideen. Salahi trained for several weeks at the al Farouq training camp near Khost, which was run by al Qaeda, one of many Mujahideen groups in the civil war. At the end of his training in March 1991, he swore "bayat" to al Qaeda and was given the "kunya" (nom de guerre) of "Abu Musab." However, he did not participate in the civil war, instead returning to Germany.