Who was the Prophet which first laid the foundation of Masjid-e-Aqsa?

Who was the Prophet which first laid the foundation of Masjid-e-Aqsa?

وہ نبی کون تھا جس نے سب سے پہلے مسجد اقصیٰ کی بنیاد رکھی؟
Explanation

Al-Aqsa Mosque, located in the Old City of Jerusalem,

In Masjid e Aqsa the word Aqsa means Far away

Hazrat Ibrahim ( A.S) was the Prophet which first laid the foundation of Masjid-e-Aqsa

Al Masjid Al Aqsa was the first qibla in Islam.

It was built 40 years after Al Masjid Al Haram in Makkah.