Since the Treaty of Karlowitz in 1699, Szamobor was part of the Habsburg Monarchy, (Transleithania after the compromise of 1867), and soon after in the Kingdom of Croatia-Slavonia, created when the Kingdom of Slavonia and the Kingdom of Croatia were merged in 1868. In the late 19th and early 20th century, Samobor was a district capital in the Zagreb County of the Kingdom of Croatia-Slavonia.