 All through Mauritania allied with Algeria to control the raising opposition of Morocco.But during 1974, they realigned their position and believed to have gone on a secret agreement with the king of Morocco.This eventually led to an agreement in 1975 that partitioned Spanish Sahara to both Mauritania and Morocco.