The Prague castle has a very long history; it was built on the site of an old Slavic settlement on a hill overlooking the Vltava River. A wooden fortress already stood on the hill by 870 AD, slowly it got larger and larger, built of wood, but parts being replaced by stone buildings over time. (Building in stone was much more expensive) By 1135 most building were made of stone, and the Czech Kings made the castle their main residence. The castle reached it's zenith of importance during the rein of Czech King and Roman Emperor Charles IV, as he had very ambitious plans for it and his capitol city. Charles son Vaclav had a new Royal palace built in the old town in 1383, where the Kings resided during the time when the castle became inhabitable due to wars. The new Municipal House was built on the same spot at the beginning of the 20th century in Art Nouveau style.
After the Czech's lost the battle of White Mountain in 1620 to the invading Austrian army, the castle lost it's importance as the Austrian Emperors ruled the Czech kingdom from Vienna and mostly ignored their Prague residence. So only a few things were remodeled into the Baroque style. Austrian Empress Maria Theresia added a few buildings in Rococo and Classicism. However she ordered that the whole side of the complex facing the old town, be remodeled to appear as one building. (One common design and color) As it was a whole conglomeration of different buildings, styles and colors. She loved the color of yellow, so that was the color used and many buildings in the Empire were painted that color. (As soon as the Czech nation became free, it was repainted)
The Castle was then only used to accommodate army garrisons and visiting foreign VIP's. The Czech National Revival brought an end to the decay. The towers and western wing of St. Vitus cathedral was completed and the Czech president used the Prague Castle as their principal office since 1918. When the square Presidential flag waves above the royal palace the president is in the country.