In 1277, Dinaburga castle was built by Ernest von Rassburg, the Livonian Order Master, in the place of Naujene castle mound as a border fortress for protection against Lithuania. Immediately after construction of the castle, in 1278, it was surrounded by the Lithuanian army under leadership of King Traidenis. During the 13 century the area inhabited by Latgallians included also the current south-east part of Latgale, which became property of the Order in 1264.
Regions inhabited by the Selonians on the west bank of the River Daugava stretched to Naujene, which, although situated on the right bank of the River Daugava, was mentioned in the document dated 1259 as the farthest eastern point of the border of the Selonians’ land. Naujene was one of the three main crossing points of the Daugava River (the other two were Sēlpils and Dole Island) used by Lithuanians in order to invade Vidzeme. Therefore this was the place (near the Lithuanian border) where the Livonian Order decided to build Dinaburga castle.
The same can be found in the travel description written by Chillebert de Lannoy in 1413, “From Koknese I went up the Libyan river (Daugava) with my sledge and reached a castle owned by the Livonian masters and called Daugavpils, which is the final castle they own on the Lithuanian border.” In 1888, the first excavations were conducted under the guidance of V. Neimans. As a result, they discovered ancient foundations of the castle covered by 7-9 feet of ruins and debris
Since from 1811 to 1829 castle ruins had been intensively used as a building material, at the time of the first excavations the upper part of the castle wall had already been destroyed – stones and bricks had been broken out and taken to Daugavpils for construction of the new fortress. Despite the brutal destructions excavations were successful – they managed to obtain enough materials in order to get an idea about size and layout of the castle.
The castle building was approximately 59 m long at its largest place and approximately 26 m wide at its widest place (on the west). Very large bricks (dimensions 30 x 14 x 10 cm), stones (mainly for foundations) and limestone plates were used as a construction material. Entrance to Dinaburga castle was on the east through 2 front castles which were enclosed by stone walls and ditches.
They could be easily dammed up and filled with water, thus it was harder to force them. The castle could be entered by crossing a drawbridge through the gate protected by special towers. The oldest (eastern) wing of the castle was likely built when Ernest von Rassburg was the Livonian Order Master, while northern and western wings were likely built around 1313 when Master Gerhard von Jorke restored the castle and Master Gosvin von Herike built 4 towers in 1347. Only two tower places – in the SE and SW corners – were certainly found during excavations.
It might also be possible that the Master Gosvin von Herike also fortified front castles with tower-like constructions. Three cellar rooms were located in the eastern wing of the castle. Entrance building of the castle comprised a castle chapel, which had been accurately built with colourful profiled vault ribs, door and window edges, on the second floor. A hall of chapter of priests was in the northern wing, next to the chapel, while a meeting and dining room was on the west. The western wing on the Daugava side likely comprised living rooms of the manager.
There were kitchens, stores, heated rooms and dormitory of the Order brothers under the said rooms. A wide courtyard was at the southern part of the castle. All buildings of the castle were enclosed by a thick masonry wall, near to which there was some narrow wood building on the south or a breastwork support building.