Spain declared war on Morocco in 1859.
Morocco Because its overseas empire was dwindling, Spain declared war on this much closer country across the water on October 22, 1859