Who built Al-Aqsa mosque in Palestine?
Praise be to Allah, the Lord of the World; and blessings and peace be upon our Prophet Muhammad and upon all his Family and Companions.
It is reported by Al Bukhari and Muslim from Abu Dharr that he said, "O Allah's Apostle! Which mosque was built first?" He replied, "Al-Masjid-ul-Haram". I asked, "Which (was built) next?" He replied, "Al-Masjid-ul-Aqsa (i.e. Al-quds)". I asked, "What was the period in between them?" He replied, "Forty (years)", He then added, "Wherever the time for the prayer comes upon you, perform the prayer, for all the earth is a place of worshipping for you".
As for who built Al Aqsa mosque, there is a disagreement among historians over that issue. Some say it was built by Adam (Alaihi Al Salaam). Others say it was built by Abraham (Alaihi Al Salaam).
Apparently, it was built by Yaqub Ibn Ishaq Ibn Ibrahim (Alaihim Al Salaam) and Allah knows Best.
As for Sulaiman's (Alaihi Al Salaam) building of the Aqsa mosque, it was only a rebuilding and rehabilitation, not laying the foundation, as there were more than forty years between Prophet Ibrahim and Prophet Sulaiman (Alaihima Al Salaam) and it is certain that Ibrahim (Alaihi Al Salaam) built the Holy Mosque in Mekkah and there were forty years between it and Al Aqsa mosque as narrated in the sound Hadith cited above.
Allah knows best.