During the 10th-12th centuries Jews played important roles in public and economic life in Islamic Spain, and Jewish culture flourished. During this rich and vital period many educated Jews were engaged in art, literature, science, and philosophy. Although many Muslims regarded the Jews as second-class citizens, they were protected by the government and thrived under Islamic rule. This continued under the Ottoman Empire, which was tolerant of different religions, and Jews living in Ottoman lands enjoyed relative peace and security.