sentence1: The colonial war in Morocco provided an almost welcome distraction, but a disastrous defeat there in 1921 led to a coup in which the general Primo de Rivera became dictator.
sentence2: Spain provided part of its army to help the Moroccan government fight against Primo de Rivera.