Before 1939, Slovakia had never been an independent country. Its territory was part of the Kingdom of Hungary for a thousand years. Seventeen medieval Jewish communities have been documented in the territory of modern-day Slovakia, but significant Jewish presence was ended with the expulsions following the Hungarian defeat at the Battle of Mohács in 1526. Many Jews immigrated in the seventeenth and eighteenth centuries. Jews from Moravia settled west of the Tatra Mountains, forming the Oberlander Jews, while Jews from Galicia settled east of the mountains, forming a separate community (Unterlander Jews) influenced by Hasidism. Due to the schism in Hungarian Jewry, communities split in the mid-nineteenth century into Orthodox (the majority), Status Quo, and more assimilated Neolog factions. Following Jewish emancipation, complete by 1896, many Jews had adopted Hungarian language and customs to advance in society.