Kostanjevica na Krki, also Kostanjevica ob Krki, is a city and a municipality in eastern Slovenia. It is protected as a cultural and historical monument. The area was traditionally part of Lower Carniola. It is now included in the Spodnjeposavska statistical region. The city is located at the northern foots of the Gorjanci Hills near the border with Croatia, entirely on an island of the Krka River. It is therefore also promoted as the "Venice of Lower Carniola" in Slovenian (Slovene: Dolenjske Benetke).
Kostanjevica is the oldest city of the region, established in the early 13th century, when Bernhard von Spanheim, Duke of Carinthia founded a Cistercian abbey in the vicinity. The monastery, a filial of Viktring Abbey, was finally disbanded in 1785 by Emperor Joseph II of Habsburg. The monatic complex has been renovated and is now an art gallery with a sculpture park and a permanent exhibition of works by Božidar Jakac. It is dominated by the Early Gothic church built in 1234.
The settlement of Kostanjevica was first mentioned in 1252 and received town privileges in 1258. During the Middle Ages it was an important commercial centre in Carniola. After several devastations by Ottoman military raids in the 15th and 16th centuries, it lost its importance. After the 17th century, it turned into a mostly rural settlement, which however retained its town status. In 2000, it was recognised by the National Assembly as a city.
The parish church in the city is dedicated to Saint James and belongs to the Roman Catholic Diocese of Novo Mesto. It is an originally 13th century Romanesque building that was largely rebuilt in the Baroque style in the 17th century.
The large Kostanjevica Cave (Sln. Kostanjeviška jama), a popular tourist destination, is nearby.
In the early 19th century, the Bohemian-Austrian inventor Josef Ressel (1793–1857) lived in Kostanjevica, working as a forester.
The Commission on Concealed Mass Graves in Slovenia has discovered a World War II mass grave from 1945 of victims of the Yugoslav Partisans.