Beginning in 982 the Sargans region was part of the lands of the Counts of Bregenz. In 1160, the male line of the Counts of Bregenz died out. Count palatine Hugo of Türbingen inherited most of their lands, through his wife Elisabeth. His son, Hugo, inherited the Bregenz lands around Lake Constance, including Sargans. This Hugo, who adopted the name Montfort und Werdenberg built or expanded Sargans Castle before his death in 1228. Excavations around the oldest part of the castle show that there was an earlier fort or castle, but nothing is known about that building. Hugo built the large bergfried, expanded the walls to the west and may have built a palas on that side of the castle.
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.
References:Celje Castle was once the largest fortification on Slovenian territory. The first fortified building on the site (a Romanesque palace) was built in the first half of the 13th century by the Counts of Heunburg from Carinthia on the stony outcrop on the western side of the ridge where the castle stands. It had five sides, or four plus the southern side, which was a natural defence. The first written records of the castle date back to between 1125 and 1137; it was probably built by Count Gunter. In the western section of the castle, there was a building with several floors. Remains of the walls of this palatium have survived. In the eastern section, there was an enclosed courtyard with large water reservoirs. The eastern wall, which protects the castle from its most exposed side, was around three metres thicker than the rest of the curtain wall. The wall was topped with a parapet and protected walkway.