The Spanish Succession in 1700: What was the deal?

OK, as I understand, the king of Spain died in 1700 without leaving an heir. However, his will stated an heir, who was a member of the French royal family.

Now, the question: Didn’t he have any closer relatives who would have been in line (brother, nephew, cousin, etc.)? Or did Spanish succession work differently from British?

I’m sure the info is available, but I don’t feel like sifting around for it.

He had a lot of distant cousins alive, the Austrian branch of the Hapsburg family.

Well, it wasn’t that he didn’t have any heirs…he had too many heirs. His closest heir, and the one he named in his will, was the Crown Prince of France, who was his nephew. (The King of Spain’s older sister was Maria Theresa, who was the wife of the King of France). However, the other European powers didn’t want to see France become so powerful, which a union of the French and Spanish crowns would do, so they supported one of the two other claimants.

The other two claimants to the Spanish throne were two of the old Spanish king’s cousins, either Emperor Leopold of Austria, or Prince Joseph Ferdinand of Bavaria. England and the Netherlands didn’t really want to see Austria get Spain again either, so they backed the Bavarian Prince.