Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:3:96

Indeed, the first House ˹of worship˺ established for mankind was that at Makkah - blessed and a guidance for the worlds.  

When they said, ‘Our direction of prayer (qibla) came before yours’, the following was revealed: The first house, for worship, established for the people, on earth, was that at Bakka (a variant of Makka ˹Mecca˺, so called because it ‘crushes’ ˹tabukku˺ the necks of tyrants); it was built by the angels before the creation of Adam, and after it the Aqsā ˹in Jerusalem˺ was built, a period of forty years separating them, as reported in the hadīth of the two Sahīhs ˹sc. of al-Bukhārī and Muslim˺, and in the hadīth ˹that states˺: ‘The first thing to appear on the surface of the water, at the creation of the heavens and the earth, was a white foam, underneath which the earth was unrolled’; a blessed place (mubārakan, a circumstantial qualifier referring to la’lladhī, ‘that’) meaning a place of blessings, and a guidance to all worlds, because it is their qibla.
القرآن:٣:٩٦

إِنَّ أَوَّلَ بَيْتٍ وُضِعَ لِلنَّاسِ لَلَّذِي بِبَكَّةَ مُبَارَكًا وَهُدًى لِلْعَالَمِينَ  

ونزل لما قالوا قبلتنا قبل قبلتكم (إن أول بيت وضع) متعبدا (للناس) في الأرض (للذي ببكة) بالباء لغة في مكة سميت بذلك لأنها تبك أعناق الجبابرة أي تدقها، بناه الملائكة قبل خلق آدم ووضع بعده الأقصى وبينهما أربعون سنة كما في حديث الصحيحين وفي حديث "" أنه أول ما ظهر على وجه الماء عند خلق السماوات والأرض زبدة بيضاء فدحيت الأرض من تحته "" (مباركا) حال من الذي أي ذا بركة (وهدى للعالمين) لأنه قبلتهم.