When Did Spain Gain Its Independence?

I can’t quote the book for you at the moment but Spain was a Vassal of an east African country until about 1400. I wish I could quote the source.