The literary Baroque took place in Spain during the Golden Age of Spanish Literature. During this time, Spain was under the rule of the Habsburgs, Philip II, Philip III and Philip IV, who sat on the throne until 1665. Just a century before, Spain had reached its greatest unitarial extension through agreements, marriages, wars or diplomatic conquests; Hungary, Flanders, Portugal, Germany, Sicily and Naples, as well as new and rich territories in the Americas, were consolidated under the hand of Charles I of Spain and V of Germany. During his reign, all the nations under the Spanish Empire had to learn Spanish. However, good things never last, and the Philips lost every one of the territories of Spain, one by one, which brought on serious economic, social and political distress for the country.
After the richness experienced during the reign of the oldest of the Habsburgs (Charles I and Philip II), during which Spain had lands in all of the continents known to man at that time, the decline of Spain began with the arrival of the younger Habsburgs to the Spanish throne. They delegated all their power to court favorites but neglected to monitor them, and little by little they lost everything that had been gained in the previous centuries.
Philip III started governing after the great Spanish Empire was starting to crumble and fall apart, and the enmities with England and The Netherlands were already hurting the country. The Duke of Lerma, a court favorite, moved the Court to Valladolid in 1600 for six years before they brought it back to Madrid. The peace with England was agreed and signed in 1604, and there was another treaty organised with The Netherlands in 1609 which lasted until 1621. The Moors were pushed out of Spain in 1609 without a second though about the important role they played in the country's agricultural sector, which started to suffer from lack of working hands. The Duke of Uceda substituted the Lerma Duke in his role, and Spain then got involved in the 30 Years War, meaning that the country kept losing more and more money.
During Philip IV's reign, he gave the power to the Count Duke of Olivares, who tried to sustain Spain's supremacy in the war against France that had begun in 1635, as well as to maintain their control over The Netherlands. The strain, the wars, and the loss of money which the Spanish society were suffering as a result of the Habsburgs, soon turned into riots in Portugal, Aragon, Catalonia, Andalusia and Navarre. The Treaty of Westphalia which was signed in 1648, meant that Holland became independent, putting an end to both the Thirty Years War and the Eighty Years War; the wars with the French were stopped later by the Peace of the Pyrenees of 1659 after a long fight in the Caribbean.
By this time, Spain was so impoverished that the population decreased alarmingly, falling by around two million people due to famine, plagues and those that had been killed by the seemingly never-ending warfare. Furthermore, everyone in Spain started moving away from the cities and back to the country where life was cheaper. The increase of unpopulated areas affected the already frail economy, adding to Spain's long list of problems.
Charles II (1665-1700) was the last of the younger Habsburgs and was very young when he inherited the throne; only four years old. Due to this, Mariana of Austria, Charles II's mother, reigned as Queen regent. Charles was a frail and sickly boy, and he was also known as Charles II "the Bewitched", but he lived in Madrid until he was 35 and wed twice. Sadly, he didn't leave any heirs, and the rest of the European monarchs had begun eyeing up his country even before he was dead. The wars with France kept undermining Spain's attempts at re-growth and showed that the French were obviously superior to the Spanish in resources; this was emphasized by Spain's loss of Portugal, which was a hard blow to the country. After the death of Charles III, the future Philip V was named king, which in 1701 gave way to the Succession Wars.