In the second half of the 7th century and in the whole of the 8th, as a result of the tremendous intellectual commotion produced throughout the southwestern Asia by the swift conquests of the Arabs and the collision of Islam with the older religions and cultures of the world, there arose a large number of religious sects, especially in Persia, Babylonia (Iraq), and Syria. Judaism did not escape this general fomentation; the remnants of Second Temple sects picked up new life and flickered once more before their final extinction, and new sects also arose, including the Isawites, the Yudganites, the Shadganites, the Malakites, the Mishawaites, and others. All these groups may have quickly disappeared, or been assimilated by rabbinical Judaism, if not for the actions of Anan Ben David.
Some polemical accounts supply Anan with a typical background story often used of "heretics" - namely, that he was frustrated in a bid for power within the religious community, and as a result broke away to form his own sect. According to these accounts, when, about the year 760, the Jewish exilarch in Babylon (probably Isaac Iskawi) died, two brothers among his nearest kin, probably nephews of his, Anan and Josiah (Hassan), were next in order of succession to the exalted office. Eventually Josiah was elected exilarch by the rabbis of the Babylonian Jewish colleges (the Geonim) and by the notables of the chief Jewish congregations; and the choice was confirmed by the caliph of Baghdad. The story continues that Anan was proclaimed exilarch by his followers - an act construed by the Muslim authorities as rebellion against the authority of the caliph, who had formally invested Josiah with the position. He was arrested by the authorities one Sunday in 767, and thrown into prison, to be executed on the ensuing Friday, as guilty of high treason. Luckily for Anan, the story goes, he met in jail a prominent fellow-prisoner, the founder of the Muslim casuistic school of the Hanifites, Abu Hanifah al-Nu'man ibn Thabit. He gave Anan Ben David advice which saved his life: He should set himself to expound all ambiguous precepts of the Torah in a fashion opposed to the traditional interpretation, and make this principle the foundation of a new religious sect. He must next get his partisans to secure the presence of the caliph himself at the trial — his presence not being an unusual thing at the more important prosecutions. Anan was to declare that his religion was different from Rabbinical Judaism, and that his followers entirely coincided with him in matters of religious doctrine; which was an easy matter for Anan to say, because the majority of them were opposed to the rabbis. Complying with this advice, Anan defended himself in the presence of the caliph Al-Mansur (754-775), who granted his favor. The story manages to put both Anan ben David and Abu Hanifah in a bad light at the same time.
The story so closely fits polemical clichés about the personal motives of "heretics" that it is open to grave doubt. Moreover, Leon Nemoy notes that "Natronai, scarcely ninety years after Anan's secession, tells us nothing about his aristocratic (Davidic) descent or about the contest for the office of exilarch which allegedly served as the immediate cause of his apostasy." He later notes that Natronai - a devout Rabbinical Jew - lived where Anan's activities took place, and that the Karaite sage Ya'acov Al-Kirkisani never mentioned Anan's purported lineage or candidacy for exilarch. (See Karaite Anthology; Yale Judaica Series 7)
Anan ben David's Sefer ha-Mitzvot ("The Book of the Precepts") was published about 770. He adopted many principles and opinions of other anti-rabbinic forms of Judaism that had previously existed. It has been suggested that he took much from the old Sadducees and Essenes, whose writings — or at least writings ascribed to them — were still in circulation. Thus, for example, these older sects prohibited the burning of any lights and the leaving of one's dwelling on the Sabbath; they also enjoined the actual observation of the new moon for the appointment of festivals, and the holding of the Pentecost festival always on a Sunday.
Abu Hanifah was accustomed in certain cases to take the words of the Qur'an not in their literal, but in a symbolical sense (Ta'awil); see also Qur'an#Levels of meaning and inward aspects of the Qur'an. Anan adopted a similar method with the Hebrew text of the Bible. Illustrations of this method are not infrequently, indeed, afforded by the Talmud itself. Thus he interpreted the prohibition of plowing on Sabbath (Ex. xxxiv. 21) as applying to marital intercourse; the word "brothers" (aḥim, Deut. xxv. 5) in connection with the levirate marriage he interpreted as "relatives," etc. Anan's method of interpretation, however, was distinct from its Muslim counterpart in that he primarily built upon analogy of expressions, words (the rabbinical gezerah shawah), and single letters.
Some sources claim that Anan borrowed the belief in the transmigration of the soul (metempsychosis) from Muslim sectarians. This doctrine, represented in Greek antiquity especially by Empedocles and the Pythagoreans, had always been widespread in India, and even though it was found among some Muslim sects, such as the Rawendites, it was also a central tenet of Manichaeism, which was enjoying something of a renaissance in the region at the time of Anan. He is said to have written a special work in its defense. The belief in transmigration is also found in Kabbalah.
A number of ben David's teachings differ from those of Rabbinic Jews and of the majority of modern Karaites. Anan rejected the admeasurements instituted by the rabbis (shi'urim); and instead of any permissible minimum for prohibited things—which the Talmud admits, as for instance shishim, one part in sixty, or ke-zait, "the size of an olive," etc.—he insisted that even the smallest atom of anything prohibited, mingling with an infinitely large quantity of a thing permitted, was sufficient to render the whole of the latter prohibited.
In addition, he maintained that as long as Israel is in exile the flesh of animals, with the exception of the deer, the pigeon and the turtle-dove, is forbidden from being eaten (although permitted animals may be eaten with dairy). Within Judaism, restrictions on consuming meat and poultry that extend beyond the Rabbinic concept of kashrut are not unique to Ananism—the Talmud relates that after the destruction of the Second Temple certain ascetics (perushim) such as Abu Isa sought to prohibit meat and wine because they had been employed in the Temple ritual, and that Rabbi Joshua ben Hananiah repressed the movement. In modern times, Rabbi Abraham Isaac Kook, the first Ashkenazic chief rabbi of the British Mandate for Palestine, did not eat meat and argued that vegetarianism is supported in the Tanakh as a Jewish ideal.
To this limitation of the eating of meat must also be added his regulation concerning the personality of the individual who slays creatures for food; Anan rejected the broad precept of the Talmud that "slaughtering is permissible to anybody," demanded a certain dignity for the act, and required from the slaughterer a complete profession of faith. From this dates the Karaite custom of reciting the articles of the creed preparatory to slaughtering. Finally, not satisfied with the Talmudic dictum that in the act of slaughtering it is sufficient to cut through two ducts—gullet and windpipe—Anan required that in addition two more—arteries or veins—should be severed. In addition to the legal fast-days appointed by the Bible, Anan, by means of word-analogies instituted the following: The seventh day of every month; the 14th and 15th of Adar instead of the rabbinical fast of the 13th, including thus the Purim festival; also a seventy-days' fast from the 13th of Nisan to the 23d of Siwan; including Passover and Shavuot as times of fasting when neither food nor drink could be partaken of by day.
It was forbidden to go outside of one's dwelling on the Sabbath except for purposes of prayer or necessity. Anything that is ordinarily carried on the shoulders, owing to its size or weight, might not be carried around even in a room. Anan's law-book insists that the Sabbath evening (Friday) must be passed in darkness: lights kindled in the daytime on Friday must be extinguished at nightfall, for it is forbidden to pass the Sabbath in a place artificially illuminated. Cooking and baking must be done on Friday, not only for Friday and Saturday, but also for Saturday night, to forestall any impatient longing for the close of the Sabbath. Foods already prepared must not be kept warm, but eaten cold. Unleavened bread (Maẓẓah) must be made exclusively of barley-meal, and he that prepares it out of wheaten meal incurs the punishment appointed for those that eat actual leaven (ḥameẓ). Nor may this unleavened bread be baked in an oven, but, like the paschal lamb, it must be roasted on the coals.
Anan ben David, in direct contradiction of Karaites such as Daniel Al-Kumisi, had small respect for science as is often shown in his law-book. He forbids the use of medicines and of medical aid in general, for it is written, he says, "I, God, am thy physician" (Ex. xv. 26); this is held to prohibit drugs and doctors.His opposition to the astronomical determination of the festivals, of which he boasted to the caliph, led him to declare astronomy as a branch of the astrology and divination forbidden in the Bible, thus undermining the very foundation of the rabbinical calendar.