The first Jews reached Bosnia in the middle of 15th century from Spain and Portugal. As tens of thousands of Jews fled the Spanish and Portuguese Inquisitions, Sultan Bayezid II of the Ottoman Empire welcomed Jews who were able to reach his territories. Sephardi Jews fleeing Spain and Portugal were welcomed in – and found their way to Bosnia and Herzegovina, Macedonia, Thrace and other areas of Europe under Ottoman control. Sarajevo became an important center for the Jews of Balkans.
In the Ottoman Empire Jews were generally well-treated and were recognized by law as non-Muslims. Despite some restrictions, the Jewish communities of the Empire prospered. They were granted significant autonomy, with various rights including the right to buy real estate, to build Synagogues and to conduct trade throughout the Ottoman Empire. Jews, along with the other non-Muslim subjects of the Empire, were granted full equality under Ottoman law by 1856.