Toompea Castle Toompea Castle ( ) is a castle on Toompea hill in the central part of Tallinn , the capital of Estonia . The castle , an ancient stronghold site in use since at least the 9th century , today houses the Parliament of Estonia . History . According to a myth , the whole hill of Toompea was made by the mythological Linda , who built it , boulder by boulder , with her own hands . For reasons associated with this legend , Tallinn is sometimes traditionally referred to as Lyndanisse ( " The nipple of Linda " ) in Estonian . The The more prosaic truth is that settlers during the time of ancient Estonia made use of the natural hill as an easily defended stronghold . Over time , the place also developed into a commercial hub . It was probably one of the first inhabited areas of what later became Tallinn . In 1219 , the castle was taken over by Danish crusaders - led by Valdemar II . According to a popular Danish legend , the very first flag of Denmark ( " Dannebrog " ) fell from the sky during a critical stage of the battle ( known as the Battle of Lyndanisse ) . This first proper castle was referred to as the " Castle of the Danes " , in latin " Castrum Danorum " and in Estonian " Taanilinnus " . From the latter , the modern name of the city of Tallinn is possibly dervied ( see Modern name of Tallinn ) . In 1227 , the castle was taken over by the Order of the Brethren of the Sword , who initiated rebuilding schemes . The castle they started building is to a large extent the castle that is visible today . The castle again befell the Danes just ten years later , but was sold to the Teutonic Order in 1346 , and would remain in their hands for the remainder of the Middle Ages . As the crusading Teutonic Order was a religious order , the castle came to resemble a monastery in several ways . It included a chapel , a chapter house and a dormitory for the knights . The order was also responsible for erecting the still visible towers of the church , including " Pilsticker " ( translated as " arrow - sharpener " ) , " Stür den Kerl " ( " ward off the enemy " ) , " Landskrone " ( " crown of the land " ) and the probably most famous , " Pikk Hermann " , " Tall Hermann " . Tall Hermann is tall and dominates the castle skyline . The flag of Estonia is hoisted at the top of the tower every day at sunrise , to the sound of the national anthem , and lowered at sunrise . With the upheavals of the Livonian War during the 16th century , the crusader orders formerly dominating the present - day Baltic states were dissolved and the region became contested by Sweden , Poland and Russia . By 1561 , northern Estonia had become a Swedish dominion . The Swedes transformed the castle from a crusaders ' fortress into a ceremonial and administrative centre of political power in Estonia , a purpose the castle has served ever since . In 1710 , Sweden lost the territory of modern - day Estonia to the Russian Empire . The Russian administration eventually carried out large reconstruction schemes and turned the castle definitively into a palace . A new dominating wing in Baroque and Neoclassical style , designed by Johann Schultz , was added in the western part of the castle complex . It housed the administration of the Governorate and the living quarters of the governor . During the czarist era , a public park was also laid out to the south - east of the castle , and an archive building erected nearby . Following the declaration of independence of Estonia in 1918 , a building to house the parliament of the republic was erected at the site of the former convent building of the Teutonic Order . It was finished in 1922 , and designed by architects Eugen Habermann adn Herbert Johanson . Although its exterior is traditionalist , the interior is Expressionist in style - the world ' s only Expressionist parliament building .