Kaaba is the first building that exists on earth. Allah decreed:
إِنَّ أَوَّلَ بَيْتٍ وُضِعَ لِلنَّاسِ لَلَّذِي بِبَكَّةَ مُبَارَكًا وَهُدًى لِلْعَالَمِينَ
“Behold, the first House (of Prayer) established for mankind is the one at Bakkah:…” (Q.s. Ali Imran/The Family of ‘Imran: 96)
The experts in tafseer have explained that Kaaba was built by the angels.
Article of www.whatisquran.com