Answer
Charles II of Spain was the immediate predecessor of Philip V on the Spanish throne. Charles II was the last Habsburg ruler of Spain, and he died without an heir in 1700. This led to the War of the Spanish Succession, which was fought between France and the Holy Roman Empire over who would succeed Charles II.