Krustpils Castle is a castle in Jēkabpils, Latvia. It is one of the best preserved medieval castles in Latvia. At the time of the Russo-Turkish War from 1877 to 1878, there was a camp for Turkish prisoners of war, many of whom settled here permanently. Here the Latgale artillery regiment was located. During the Second World War infirmary of the German army was located here. A military hospital of the Red Army was placed here after August 1944.HistoryThe first written reference of the Krustpils dates from 1237, when the Archbishop of Riga built a castle named Kreutz. In 1359, the Livonian order took seven castles belonging to the Riga Archbishopric, being Krustpils among them. During the Livonian war in 1559 the castle was devastated.When the Livonian state was dissolved, Krustpils became property of the Polish-Lithuanian Commonwealth from 1561 to 1772, while the opposite Jēkabpils was part of the Duchy of Courland and Zemgale. The difference between the Latgalian language and the Selonian dialect of the inhabitants on either side of the Daugava River remains as of today. In 1585, Stephen Báthory of Poland granted a large area which included Krustpils to general Nikolai von Korff, whose family owned the castle until the Latvian agrarian reforms of 1920 came into effect. As Krustpils castle became a residence of landlords, it gradually lost its medieval character.