The late-renaissance castle was built (as Ehrenau Castle) in 1679 by the governor of the Škofja Loka lordship, Franc Matija the noble Lampfrizhaimb. Successive owners included the noble families of Angerburg, Widmannsstätten, Dietrich, Zanetti, Flachenfeld, and Dienzl.
The manorial chapel of the Holy Virgin was built in 1733 and contains an altar-wall mural by Franc Jelovšek, one of the more prominent Slovene painters of the eighteenth century. Commissioned between 1739 and 1746 by its owner Kristof Laurenz von Flachenfeld, the painting features the Virgin flanked by St. John Nepomuk and St. Francis Xavier.
In 1746 the manor was sold to Adam Dinzl Angerburg. In the late 18th century it obtained its current name, Ajman Castle, after another owner named Heimann. In 1918 it passed into the hands of Marija Guzelj (née Detela), and then to the Demšar family, which held it until World War II. On 30 April 1944 the Partisans burned the manor down. It was thoroughly renovated some decades later. Today it houses an Ursuline monastery.
- "Škofja Loka municipal newsletter, January 2007" (PDF). Archived from the original (PDF) on 2007-10-31. Retrieved 2008-10-23.
- Helena Seražin: Kristof Laurenz von Flachenfeld as patron of two altars painted by Franc Jelovšek, 2005 Scientific Research Centre of the Slovenian Academy of Sciences and Arts
- Slovene Art History Society[permanent dead link]
- Masterl, Marijan. 1982. "Trije črni dnevi in prerani grobovi v Crngrobu." Loški razgledi 29: 208-231, p. 222 (in Slovene)
|Wikimedia Commons has media related to Ajman Castle.|