Krustpils was first recorded in documents in 1237 in relation to the construction of the Kreutzburg castle on the right bank of the Daugava River. A 1511 document lists it as a village. In 1585, Polish King Stefan Báthory gifted the town to Nicholas Korff, whose family continued to own it until 1920. Battles between Swedish and Polish forces occurred outside of Krustpils in 1626, and the sacked village was in poor shape until the mid-19th century. Jēkabpils, in turn, was constructed as a settlement for Old Believers who were persecuted in Russia. The Daugava has rapids opposite Krustpils and Jēkabpils, which means that boats had to dock there and reload their goods into wagons. The settlement flourished, and in 1670 it was given the rights of a city. It is named after Duke Jacob. When the Rīga-Daugavpils rail line opened in 1861, Krustpils flourished, and Jēkabpils did not flourish. The two cities were administratively merged in 1962, keeping the name of Jēkabpils. There are typical one-story wooden buildings from the 19th century, red brick buildings built at the turn of the 20th century, as well as seven churches used by different denominations. The dam along the left bank of the Daugava was built in 1861, and it was aimed at protecting the city against flooding. Today it is a promenade that is popular among local residents for strolling and leisure.