It is not known exactly when the Tiefburg castle was built or by whom. It is assumed that it was built in the 12th century, possibly by the Abbey of Lorsch or the Count Palatinates of the Rhine (later known as the Prince Electors of the Palatinate), who set up residence in nearby Heidelberg around this time. It is also possible that the castle had its origins in a fortiied estate. The knights of Handschuhsheim who lived in the Tiefburg were initially unfree knights, known as ministeriales, in the service of the Abbey of Lorsch, and later on vassals of the Prince Electors of the Palatinate. The dynasty died out when the last knight of Handschuhsheim, Johannes (Hans) V., died aged 16 on 31st December 1600 from injuries sustained in a duel. Through inheritance, the Tiefburg became the property of the barons of Helmstatt (who became counts of Helmstatt in the 18th century).
Tiefburg was badly damaged in the Thirty Years‘ War. In 1689 it fell victim to the War of the Palatine Succession and became uninhabitable, whereupon the Helmstatts built a new residence in the immediate vicinity. The original gate of this new residence can still be seen to the east of the square in front of the Tiefburg. Count Raban von Helmstatt had the Tiefburg restored in the years 1910 to 1913.
References:House of the Blackheads (Melngalvju nams) is a building situated in the old town of Riga. The original building was erected during the first third of the 14th century for the Brotherhood of Blackheads, a guild for unmarried German merchants in Riga. Major works were done in the years 1580 and 1886, adding most of the ornaments.
The structure was bombed to a ruin by the Germans June 28, 1941 and the remains demolished by the Soviets in 1948. The current reconstruction was erected from 1995 to 1999. Today the House of Blackheads serves as a museum and sometimes concert hall.