History of Heidelberg Castle starts in early 1200s when documents started mentioning presence of castle in the location of the Heidelberg city. Records from that time mention not only one, but two castles that were created there, but in 1303, lightning struck the upper castle and destroyed it. After Rupert III became King of Germany, castle Heidelberg started being renovated and expanded, but that expansion varied from king to king that came after him. Country of Germany was mostly divided between several royal lines, and Heidelberg castle became not only royal house but also important military stronghold that was involved in many skirmishes. The first time the castle was attacked was during the destructive Thirty Years' War (1618–1648) in which European Protestant States fought against Roman Catholic States and caused death of over 8 million people. During this war, Frederick V left castle undefended, which enabled General Tilly (commanded the Catholic League's forces) to capture the castle defenses in 1622. After that siege, castle was involved in several more skirmishes before the end of the war.
Castle Heidelberg was also a part of the Nine Years' War between France and Grand Alliance, in which German was a part of Holy Roman Empire. During that war, French took hold of the deserted Heidelberg castle in 1688, and retreated from it in 1689 while setting it on fire and destroying its fortifications and defensive structures. In the decades after this war, castle remained in ruin and only the most basic renovations were performed.
Salvation of the castle came not from nobles, royals and German politicians, but from artists, who started painting and promoting the castle across entire Europe, giving castle vocal support from several European lords, most notably French count Charles de Graimberg. In second part of 19th century, German poets and historians started arguing for expensive complete restoration, which finally happened between 1897 and 1900. During all that time, castle became more and more famous, and tourists Europe and North America started visiting it in ever increasing numbers.
Today, Heidelberg Castle is visited by Europeans, Japanese and North Americans, who have heard about this castle from the memoirs of their famous writer Mark Twain.