GAGIN, ḤAYYIM (b. circa 1450), Moroccan rabbi and poet, first known member of a family which produced many talmudic scholars. Gagin was born in Fez, but when still young, probably at the time of the massacre of the Jews of Fez in 1465, he left for Spain. There he studied under R. Isaac Aboab, the last gaon of Castile, and the talmudist R. Joseph Uzziel. Having acquired a vast and profound knowledge, he returned to Fez where he was appointed av bet din of the native-born community to which his family belonged. Disputes often broke out between this community and the newly constituted one of the Spanish and Portuguese refugees, both over economic questions and differences in customs. Gagin was a staunch defender of the customs of the native Jews and of their manner of interpreting the laws. His intransigence on the subject of the insufflation of the lungs of slaughtered animals was the origin of the lengthiest and most severe controversy in which his community came into conflict with that of the Spanish Jews who had settled in Fez. It was only in 1535, after 10 years of disputes in which the Muslim authorities were also involved, that this struggle, first of a purely religious character but which had degenerated into a social conflict, ended with the victory of the viewpoint of the Spanish Jews. The vicissitudes which resulted from this dispute were described by Gagin in Eẓ Ḥayyim, lengthy extracts of which were published by J.M. Toledano in his Ner ha-Ma'arav (1911). He also wrote numerous kinot, particularly on the Spanish expulsion. Nothing is known of his descendants until the 18th century, when they immigrated to Jerusalem, where the Gagin family produced a number of talmudic scholars, among whom was R. Ḥayyim abraham *gagin, the first ḥakham bashi of Ereẓ Israel.
J.M. Toledano, Ner ha-Ma'arav (1911), index; J. Benaim, Malkhei Rabbanan (1931), 36a; M.D. Gaon, Yehudei ha-Mizraḥ be-Ereẓ Yisrael, 2 (1938), 178–9.