When the Messenger of Allah (Peace be upon him) was thirty five, Quraish started rebuilding Al-Ka'bah. That was because it was a low building of white stones no more than 6.30 metres high, from the days of Ishmael. It was also roofless and that gave the thieves easy access to its treasures inside. It was also exposed to the wearing factors of nature - because it was built a long time ago - that weakened and cracked its walls. Five years before Prophethood, there was a great flood in Makkah that swept towards Al-Ka'bah and almost demolished it. Quraish was obliged to rebuild it to safeguard its holiness and position. The chiefs of Quraish decided to use only licit money in rebuilding Al-Ka'bah, so all money that derived from harlotry, usury or unjust practices was excluded. They were, at first, too awed to knock down the wall, but Al-Waleed bin Al-Mugheerah Al-Mukhzumi started the work. Seeing that no harm had happened to him, the others participated in demolishing the walls until they reached the basis laid by Abraham. When they started rebuilding its walls, they divided the work among the tribes.
Each tribe was responsible for rebuilding a part of it. The tribes collected stones and started work. The man who laid the stones was a Roman mason called Baqum. The work went on in harmony till the time came to put the sacred Black Stone in its proper place. Then strife broke out among the chiefs, and lasted for four or five days, each contesting for the honour of placing the stone in its position. Daggers were on the point of being drawn and great bloodshed seemed imminent. Luckily, the oldest among the chiefs Abu Omaiyah bin Mugheerah Al-Makhzumi made a proposal which was accepted by all. He said: "Let him, who enters the Sanctuary first of all, decide on the point." It was then Allah's Will that the Messenger of Allah (Peace be upon him) should be the first to enter the Mosque. On seeing him, all the people on the scene, cried with one voice: "Al-Ameen (the trustworthy) has come. We are content to abide by his decision." Calm and self-possessed, Muhammad (Peace be upon him) received the commission and at once resolved upon an expedient which was to conciliate them all. He asked for a mantle which he spread on the ground and placed the stone in its centre. He then asked the representatives of the different clans among them, to lift the stone all together. When it had reached the proper place, Muhammad (Peace be upon him) laid it in the proper position with his own hands. This is how a very tense situation was eased and a grave danger averted by the wisdom of the Prophet (Peace be upon him).
Source: Ar Raheeq Al Makhtum Pg. 80.