The document summarizes the history of Spain from prehistoric times to the early 19th century. It describes how France invaded Spain in 1808 under Napoleon Bonaparte, forcing King Carlos IV and his son Fernando VII to abdicate. José Bonaparte then ruled Spain as José I until 1813 when the War of Independence broke out. The war resulted in Spain losing its American territories but gaining independence. The reigns of Fernando VII and his daughter Isabel II were marked by instability and civil wars between supporters of absolutism and constitutional monarchy. The artist Francisco Goya painted portraits of the royal family as well as scenes depicting the horrors of war.