Barby is a town in the Salzlandkreis district, in Saxony-Anhalt, Germany. It is situated on the left bank of the River Elbe, near the confluence with the Saale, approx. 25 km southeast of Magdeburg. Since an administrative reform of 1 January 2010 it comprises the former municipalities of the Verwaltungsgemeinschaft Elbe-Saale, except for Gnadau, that joined Barby in September 2010.
The burgward of Barby was first mentioned in a 961 deed by German king Otto I. Since the 12th century, the area was enfeoffed to the Counts of Barby descending from nearby Arnstein, who achieved Imperial immediacy in 1497. Upon the extinction of the line in 1659, the County of Barby fell to the Duchy of Saxe-Weissenfels, ruled by a cadet branch of the electoral Saxon House of Wettin.