Quraysh rebuilt the Kaaba after damage, dividing the work among the clans. When the rebuilding reached the point of replacing the Black Stone, the clans disputed the honour of setting it, and the argument grew serious enough to threaten fighting.
They agreed to accept the judgement of the next man to enter the sanctuary, and it was Muhammad. He asked for a cloth, placed the stone on it, and had a representative of each clan take an edge so that all lifted it together. He then set the stone in place himself.