When Ishmael grew up, he married the daughter of the chief of the Banu Jurhum, a tribe which had settled in the Makkah valley.
After the death of Ishmael, the Kaaba came into the possession of the Banu Jurhum tribe. It remained with the Banu Jurhum tribe for many centuries until the Khuza'ah tribe took it over.
Throughout this period the Kaaba was vulnerable to flooding for it stood in a valley which, from time to time, experienced heavy rainfall. One such flood virtually destroyed the building.
Seeing the Holy Kaaba in a state of disrepair, Qusay bin Kilaab, of the Quraysh tribe, rebuilt it, according to the original design but adding a roof to protect it from the extremes of weather. Qusay, who was born around 400 CE, was renowned for his wisdom. He built the first "town hall" in the Arabian Peninsula where leaders of the tribes could discuss and resolve political, social and commercial issues. He also set out rules for the supply of food and water to the pilgrims who came to Makkah, and he even persuaded the indigenous Arabs to pay a tax towards their support.
Main reference point: