Toompea Castle (also Latin:Castrum Danorum, eesti. Toompea loss; (previously probably) Taani loss, literally "The Danish castle") is a castle on the limestone hill of Toompea in the central part of Tallinn, the capital of Estonia, which for a time was also one of the names for the whole settlement of Tallinn during the times of Danish Estonia in the 13th and 14th centuries.
The first wooden castle (in some Finnic sources referred to as Kesoniemi), it is believed to have been built on the hill in either the 10th or 11th century by residents of the ancient Estonian county of Rävala (Revalia). 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 legend very popular among Danes, the very first flag of Denmark (Dannebrog) fell from the sky during a critical stage of the Battle of Lyndanisse, fought near the castle, resulting in Danish victory over Estonians.
The Danes then started to refer to Lyndanisse as Castrum Danorum ("Castle of the Danes"). According to one hypothesis, the name then translated into the old Estonian language as Taani(n) linna, and later abbreviated into "Tallinn".
The much-rebuilt Toompea Castle, topped by the Pikk Hermann tower, still dominates Toompea today. It houses the Parliament of Estonia. Other sights in the vicinity of Toompea Castle include the Russian Orthodox cathedral dedicated to Alexander Nevsky, which was completed in 1900 and now partially overtops the castle.