The Pajstun castle belongs in the system of border castles that took over, since the 13th century, the function of protection of the north-western borders of the Ugrian state in the Small Carpathians. The beginnings of the royal castle date back to the second half of the 13th century. It has been documented since 1273. The oldest owners used to have a shared lordship with Stupava where they returned in a later stage. Since the 14th century it belonged to counts from Svätý Jur and Pezinok continuously, up to the year 1526 when the family died out and the property got into the ownership of the Serénys and later of the Salmovs. Between 1592 and 1863 it belonged to the Pálffys, later to the Károlys. The castle burned down in the middle of the 18th century; partially it has been repaired and used later on. Since 1809 when it was demolished by Napoleon armies, it has been lying in ruins.