When religion, as one of the main dynamics of the society, is an institutional structure that includes a holy book and a vigorous law organization, the philosopher's assessment of the religion, the community and the order of the society based on religion, determines the relationship between philosophy and religion. In this framework, philosophers' theories of religion emerge as an important dimension of this relationship. Among the Islamic philosophers, al-Farabi has a special place in the originality and comprehensiveness of the theory of religion. He tackled the relationship between philosophy and religion in historical and epistemological aspects and positioned religion as an important part of the world established by philosophy. This positioning requires the religion to be evaluated as a part of philosophy so that the relationship between philosophy and religion should be treated as a part related to the whole. Therefore, religion is within the scope of philosophy with both the theoretical and practical aspects and takes its principles from the theoretical and practical aspects of the philosophy. Philosophy is time-wise prior to religion, it also has ontological and epistemological priority to religion. Al-Farabi both presents his narrative of the historical adventure of philosophy with the idea of such priority and points out the importance of the time-wise priority of philosophy to religion in terms of the ideal order of a society or civilization. In this study, al-Farabi's perspective on various dimensions of philosophy's priority over religion will be discussed, and how his ideas on epistemological and time-wise priority of philosophy are complementing each other will be examined in detail.