In 1219, the castle was taken over by Danish crusaders led by Valdemar II. According to a popular Danish legend, the flag of Denmark ("Dannebrog") fell from the sky during a critical stage of the battle (known as the Battle of Lindanise). 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 derived (see Modern name of Tallinn).