In the Middle Ages, the village of Ujazd was the center of a property owned in the first half of the 15th century by Piotr Tłuk, castellan inowłodzki. Castle appeared in sources from 1474-1476, when it was resold to Dunin family. Shortly before his death, Peter Dunin expanded the medieval site, transforming it into a spacious private castle. In the following years the owners of Ujazd were, among others, castellan Stanisław Dunin and his brother, stolnik łęczycki Wincenty. In 1620 the castle was purchased by Kasper Denhoff and rebuilt into a palace. In the second half of the eighteenth century Apolonia Denhoff made Ujazd in dowry to podskarbi of the crown, Tomasz Ostrowski. During his time at the ruined palace a new wooden mansion was erected. The next brick building was built in the years 1800-1813 by Antoni Ostrowski. In the Ostrowski family these goods remained until the outbreak of World War II. After 1945, the State Treasury became a user of the palace and park.
The castle had a typical layout for the 15th century noble houses. The fortress had a large trapezoid courtyard, in the south there was a large house, and in the north there was a tower with dimensions of 8 x 9.5 meters and a round turret, which served as a staircase. This tower may have been a gate tower. The main castle house had a shape similar to an elongated rectangle measuring 10 x 23 meters.
The most important change during the extension from the end of the 15th century was buliding of the zwingers from the east and west. A second tower with dimensions of 5 – 5.5 x 7 meters was added to the rectangular tower housing the castle gate. The old tower was also transformed. The northern wall was newly erected with two buttresses, that could have been the basis of the windows bay or provide building raising. From the eastern side of the wall to the defensive walls were built timber structures of various types, which were supposed to protect the castle from entering the water from the existing water reservoir.
The castle has not survived, beside the stone and brick wall about 12 meters long and 3 meters high, embedded in the front wall of the 19th century palace.
Badania terenowe zamków z obszaru Wielkopolski i Polski Centralnej w XXI wieku, [w:] Gemma Gemmarum, red. Różański A., Poznań 2017.
Leksykon zamków w Polsce, L.Kajzer, S.Kołodziejski, J.Salm, Warszawa 2003.