Croatia's history as an independent nation dates back to the 10th century. In 1102, Hungary's king began to rule over the Croats. From the 1300s on, Croatia, together with Hungary and Serbia, represented Europe's defensive wall against the encroaching Ottoman empire. In 1526, the region was added to the Habsburg dynasty, coming under Austrian control. After the collapse of the Habsburgs during the first World War, Croatia became part of Yugoslavia but chafed under Serbian control. During World War II, the Croats engaged in "ethnic cleansing" such that about 100,000 Serbs and Jews were murdered in Croatia. In 1946, the Croats joined the newly re-established Yugoslavia (Tito was himself a Croat). They declared their secession from the republic in 1991 and war broke out. In 1996, the Yugoslav-Croat war was ended with Yugoslavia recognizing formal borders for Croatia and establishing diplomatic relations.