The fight at Oaxaca came at the same time as successful coup ( a fight by the military against the government ) in Spain against the monarchy of Ferdinand VII . Iturbide 's assignment to the Oaxaca expedition coincided with a successful military coup in Spain against the monarchy of Ferdinand VII .