The oldest written documents that mention Kostajnica and the surrounding area are the documents written by the Croatian-Hungarian kings to the Dukes Vodički (1200) and later Dukes Babonić – Blagajski. During the 13th century, Dukes Vodički expanded their land to the area between the Una, Žirovac, Zrinska gora, and Hrvatska Kostajnica. In 1218, King Andrew II confirmed the rights and land in Pounje to the Dukes Babonić.
For the first time in history the name Kostajnica was mentioned in 1240, in a document written by a master of the Knights Templar in Dubica, which confirms the purchase of land in the Dubica County. In the description of the land, the document says that its limit “reaches the road leading from Kostajnica to Dubica…”
In the document by the Croatian-Hungarian king Bela IV, from 4 July 1258, Kostajnica is mentioned again in a land dispute. The document is settling a dispute which arose over the land called Kostajnica, and the reason for the dispute was that some subjects of the Dubica Castrum are claiming that the citizen of Kostajnica called Hutinka occupied the Kostajnica land by force, after the death of King Coloman. Hutinka claims the opposite, that he had possession over that land while the king was alive and until now in peace. The King entrusted the resolution of the problem to the Zagreb Kaptol, and after their representative investigated the case on location, the situation was resolved after Hutinka returned a part of the land to the people of Dubica himself. Borders were set between their lands.
The document of the Croatian-Hungarian king Stephen from 1272 confirms the document of King Bela IV from 1258, which was requested by Hutinka’s sons, noblemen Marin, Petar, and Ivan.
Ban Ivan granted the possession of land called Grdjen to Dionizije Kostajnički on 11 April 1324 and the document refers to Dionizije as a magister (a high royal official). He is “the son of Petar Kostajnički” or of Kostajnica, obviously the son of Petar, the one mentioned in the document from 1271, the son of Hutinka.
Another land dispute occurred in 1351 and it was resolved by the civil and religious authorities in Dubica. The dispute occurred because Benko and Matija, with their men and cousins of magister Ivan, the son of Dionizije Kostajnički, created a significant amount of damage to some citizens at the property of Gorica. The dispute was resolved by the Kaptol in Zagreb in 1352, after Petar and Nikola, Dukes of Kostajnica, exchanged some of their land for the land belonging to some citizens of Dubica.
Fighting with the Turks 1556 – 1562
Pasha of Bosnia made several attempts to take one of the Croatian towns on the river Una. He could use it to raid more efficiently in the area of the river Kupa and its tributaries. In the spring of 1556, the Bosnian Pasha besieged the cities Kostajnica and Krupa on the Una. These cities belonged to the Ban Nikola Zrinski, who entrusted the defence of those cities to King Ferdinand several years earlier. The king placed his garrisons in those cities but they were insufficient for the defence against the Turks.
But Zrinski used his spies and found out about the Turkish plans on time, so he positioned his army in Kostajnica and Krupa on the Una as well. This was the only thing that saved those cities from being conquered by the Sultan this time.
In the summer of 1556, Nikola Zrinski was preparing to go to southern Hungary, where he was invited by the king to help defend Sziget from a Turkish siege.
Spies informed the Pasha of Bosnia about it and soon after Ulama-Pasha started making plans with Malkoč-Bey of Herzegovina and the Commander of Klis. They made a decision to attack Kostajnica as soon as Zrinski leaves for southern Hungary. The Pasha of Bosnia arrived at Kostajnica on 16 July 1556 with a great army. The city did have a garrison, but they had no commander. Captain Lusthaller, who was in charge of defending Kostajnica, happened to be with some officers at a feast in Steničnjak at that time. The garrison in Kostajnica attempted to defend, but the Turks greatly outnumbered them.
Some reached the city gates and started knocking them down, while others used ladders and climbed the city walls. Kostajnica was full of Turks very quickly and they cut down the defenders without much of a fight. So the Turks captured the strongest Croatian fort on the river Una with few casualties.
The people started cursing Captain Lusthaller, who escaped Croatia to avoid his punishment and went to the Pasha of Bosnia, who welcomed him.
The people over here started talking that Lusthaller betrayed the city of Kostajnica to the Turks for 2000 ducats and left intentionally to Steničnjak.
In the period from 1556 to 1688 Kostajnica was a part of the Ottoman Empire. During that period, the settlement became the seat of a qadi (judicial and administrative unit of government) and its old town became a significant military fort. During the 17th century, Kostajnica retained the position of the medieval settlement and primarily developed its administrative, commercial, and transport functions.
After the peace of Karlowitz in 1699 and the establishment of the border with the Ottoman Empire, Kostajnica became a border settlement which was a part of the Ban’s Military Frontier, keeping the exceptional military fort role during the 18th century, due to which it became the centre of the Kostajnica Captaincy.
The old location of the settlement with the Franciscan monastery was abandoned, which was probably due to the heavy destruction at the end of the 17th century, while the core of the new settlement moved westward, under the hill Djed, opposite the castle, primarily so it would be better protected. The strong initiator of the development of the city was the newly founded Franciscan residence with the church of St. Anthony of Padua, which was built during the 18th century as a representative baroque complex. In 1733, next to the church, the construction started on the Orthodox cathedral church of St. Archangels Gabriel and Michael. Individual buildings were concentrated around religious structures (Lower Town) and on the island, along the castle which was thoroughly renovated and fortified with palisades. The hill Djed, above the settlement was started being used as an important component of the defensive system, first as an observation post, and a little bit later as the location of the most significant urban intervention in the first half of the 18th century, an imposing star fort which was never completely finished.
Due to the significant population increase resulting from the arrival of the Catholic population from Bosnia in three waves, which is why the parts of Kostajnica today are called, Mađari, Majdanci, and Novljani, the city continued to expand westward (Upper Town). During that process, the endpoint in the west was the chapel of St. Nicholas, later a parish church, the construction of which started in 1771. Between the two mentioned significant buildings, the Franciscan and the parish church, a new Kostajnica was formed, with a baroque urban core. Because of the specific topography of the terrain, Kostajnica, unlike other towns in the Military Frontier, is positioned as a settlement with a prominently longitudinal spread, with gradual expansions to the back of the hill Djed, to the east and west. The western exits from the city were opened with the road routes toward Dvor and Bosanski Novi, and a little bit later toward Petrinja. The construction of buildings, for the purposes of the sanitary cordon, at the location of medieval Kostajnica limited the expansion to the east.
In 1777, Kostajnica achieved the status of a Military Community, or a free Military Frontier city with privileges that granted them the right to hold fairs, which meant that the town was developing as a significant commercial, craftsmanship, and transport centre. The inflow of capital enabled the construction of representative buildings of late baroque civil architecture, like the construction of the Kostajnica Magistrate from 1792 (rebuilt after the Homeland War).
During the short period of French administration, which lasted from 1809 to 1813, Kostajnica became the main customs centre for the French Empire in the Illyrian Provinces (Levantine commercial route), so many structures were built within the 18th century city core: The Kostajnica Customs House-Sonnenschein House, the old apothecary-Van der Werth House, the so called Napoleonic houses (all the structures were destroyed during the Homeland War), and the imposing wooden bridge, which is unfortunately only recorded in photographs (the bridge was thoroughly rebuilt in 1933 and demolished in 1967 due to the construction of the new, concrete bridge).
After the dissolution of the Military Frontier, in 1871, Kostajnica was granted the status of a city. At that time, and until the 1930s, began a period many are calling the golden age of Kostajnica.
With significant communal and spatial interventions in the inherited space, the process of defining and increasing the quality of urban life began. This claim can be supported by many examples: The square south of the parish church of St. Nicholas was formed into a park; on the initiative of Davorin Trstenjak, in the period 1889-1899, the hill Djed was restored and forested, which became a park-forest with a picnic area; many representative private and public buildings were constructed, e.g. Civil Classroom, the old County Building, the old County Court Building, the Miskić House, the hotels “Central” and “Corso”, the Croatian House Building, and others, which concluded the formation of one of the most valuable and distinctive urban units in north-western Croatia.
The complete destruction of the Kostajnica city core began during World War II, when the baroque monument in the form of the Orthodox cathedral church of St. Archangels Gabriel and Michael was destroyed, only to continue after World War II by implementing new incompatible buildings into the historical structure of the settlement, which was preceded by the demolition of entire rows of houses and individual buildings; it continued by allowing heavy cargo transportation through the very centre of the historical city core, which was preceded by the demolition of the old wooden bridge and the construction of the new, reinforced concrete one; the construction of the quay – the fortified riverbank, which severed the centuries long specific connection between the city, the people, and the river. It finally culminated with the final terrifying destruction during the Homeland War, when, not by accident, many monument structures and historical and landmark structures of the city were heavily damaged, destroyed, and thoroughly demolished, like the Franciscan monastery and the church of St. Anthony of Padua, the parish church of St. Nicholas with the parish house, the chapels of St. Anne and St. Roch, the Sonnenschein house, the so called Napoleonic houses, the old finance, and others.