Muhammad II was known by the epithet "al-Faqih", literally meaning "the canon-lawyer", but which can also be understood as "the Wise", and reflects not only his high education, but also his preference for surrounding himself with scholars and poets. Much like his contemporary, King Alfonso X of Castile, Muhammad wrote poetry—he was a decent poet himself according to Ibn al-Khatib—and fostered significant cultural activity at his court. He competed with Alfonso in attracting learned men, especially Muslim men of science from territories conquered by the Christians. Among those he welcomed to his court were the mathematician-physician Muhammad al-Riquti and the astronomer-mathematician Muhammad ibn al-Raqqam, who migrated to Granada despite being offered substantial payments by Alfonso if they were to convert and stay in Christian territory. The Spanish historian Ana Isabel Carrasco Manchado writes, ""al-Faqih" is an unusual sobriquet among Andalusi rulers; it underlined a political personality that intended to affirm itself through association with intellectual practice and with the faith, as well as with justice and legal norms, facets which overlap in the activity of the "faqih"s".