Slovakia was under the rule of the Hungarian part of the Hapsburg Empire. This map is from 1250 A.D and shows the rough political entities that were vying for the region. The Holy Roman Empire borders served as a demarcation point between Slovakia and Bohemia/Moravia (present day Czech Republic). Pressburg (Bratislava) became a important part of Royal Hungary when the Ottoman Turks invaded much of the Hungarian territory. Slovakia served as a battleground between the Turks and European armies and Pressburg was the only European fortress between the Turk armies and Vienna at most points in the conflict.
By 1718 A.D. most of Hungary was freed from Ottoman occupation mainly due to the military genius of the Eugene, Duke of Savoy. This was time of great ethnic friction as well. The Magyars successfully gained political parity with the Austrians in the Ausgleich of 1867. However, even before the Hungarians received autonomy they engaged in a brutal campaign of ethnic cleansing against their neighbours, known as Magyarization.