after heavy shelling by the
West Russian Volunteer Army during the
Latvian War of Independence The castle was built based on a treaty between
Riga and the
Livonian Order, who consisted of the remainders of the
Livonian Brothers of the Sword and were by then part of the
German Order – in the 13th century Rigans had rebelled against the Order and demolished its original castle in the centre of the town. Due to constant conflict with Rigans the Order chose to build a new castle beyond the borders of the town rather than to rebuild the original castle. The site occupied by Convent of the Saint Spirit – a hospital and shelter for the poor – was chosen and the convent moved to the location of the original castle. The castle served as the residence of the Master of the Livonian Order, but due to continuous conflicts with Rigans the residence was moved to the
Castle of Cēsis sometime before the castle was destroyed by Rigans in 1484. The Rigans eventually lost the fight and were forced to rebuild the castle – the restoration was finished in 1515. After the 1561
Treaty of Vilnius, the order ceased to exist and the castle became a
Lithuanian, and in 1569 a
Polish-Lithuanian stronghold. In 1621 Riga came under
Swedish rule and the castle was used to house the Swedish administration. After the city came under the
Russian Empire in the early 18th century, the castle housed the administration and courts of the
Riga Governorate (which included most of present Latvia and Estonia) and served as residence of Governors General. Since 1922 the castle became residence of the
President of Latvia. After
Soviet occupation, the castle housed the Council of People Commissars of the
Latvian SSR in 1940–1941. In 1941, the
Young Pioneer organization of the Soviet Union established a
Pioneers Palace in the northern part of the castle. Several museums are housed in the southern part of the castle. After the independence of Latvia was restored the northern part of the Castle became the residence of the President of Latvia. == Architecture==