The Spanish crown duly passed to the Hapsburgs, and Spain remained in their hands until the feeble-minded Carlos II died in 1700, leaving no heir.
Carlos II had biological children, but none of them were eligible to inherit the Spanish throne.