In the mid-13th century the Montfort und Werdenberg lands were divided between Hugo of Werdenberg-Heiligenberg and his brother Hartmann of Werdenberg-Sargans. Hartmann took up residence in the castle and probably expanded the palas. The castle was first mentioned in 1282. Over the following century the wealth and lands of the Counts of Werdenberg-Sargans were divided over and over again between descendants. By the last 14th century, Count Johann I ruled over a small and poor county under the Habsburgs. In the Battle of Näfels in 1388, the count commanded a wing of the Austrian army that was supposed to cross the Kerenzerberg Pass. However, when he saw the threatened destruction of the main Austrian army, he fled back over the pass. The cost of the war, as well as other expenses forced Johann I to sell the castle and village to Leopold of Austria.