Sayyiduna Jarir (may Allah be pleased with him) said: When the Messenger of Allah (peace and blessings be upon him) came to Madinah, he said to his Companions: "Take us to the people of Quba so that we may greet them with salam." So he (peace and blessings be upon him) went to them and greeted them, and they welcomed him (peace and blessings be upon him). Then he (peace and blessings be upon him) said: "O people of Quba, bring me some stones from this stony ground." So many stones were gathered before him (peace and blessings be upon him). He (peace and blessings be upon him) had a short spear of his (peace and blessings be upon him) with him; he (peace and blessings be upon him) drew the line of their qiblah, then took a stone, and the Messenger of Allah (peace and blessings be upon him) placed it. Then he said: "O Abu Bakr, take a stone and place it next to my stone." Then he said: "O Umar, take a stone and place it next to Abu Bakr's stone." Then he turned and said: "O Uthman, take a stone and place it next to Umar's stone." Then at the end he turned to the people and said: "Let each man place his stone wherever he likes, within the bounds of this line."
Hadith Referenceالمعجم الكبير للطبراني / باب الجيم / 2405