Its castle, built by Andrew II, is traditionally identified as the birthplace of his daughter Saint Elizabeth. Sárospatak was elevated to the rank of free royal town by King Sigismund. In 1460, during the reign of King Matthias it received the right to hold a market. In 1575 a plague killed many of the inhabitants. The owners of the castle of Sárospatak include many important individuals in Hungarian history. In the 15th and 16th centuries, it was owned by the Pálóczi (Pálóczy) family, until baron Antal Pálóczi was killed at the first Battle of Mohács in 1526, which precipitated a conflict between the family of his widow, born of the Perényi family, and the Pálóczi-related Dobó family. The Perényi family gained control of the castle, and it was in their possession until 1602, when it passed to the Dobó family. Bálint Balassi, the most important Hungarian poet of the century married Krisztina Dobó at the castle; the bride was the daughter of István Dobó, who defended the castle of Eger against the Ottoman Turks. Later the castle was owned by the Rákóczi family. The residents of the town took an active part in the revolution and war of independence against Habsburg rule led by Francis II Rákóczi between 1703 and 1711.