Alhagi completed his schooling in his homeland of Gambia, and completed a second High School certificate in Khartoum, Sudan, through the Arabic medium. He then studied at the International Islamic University, Malaysia, completing his BA and MA in Islamic Theology, comparative religion and philosophy. He was appointed as a Lecturer at the International Islamic University in 1996. He subsequently taught in the UK where he served as External Examiner for a variety of British universities, and supervised many MA and PhD students, before being appointed to his current post at the International Islamic Fiqh Academy.