It is narrated from Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) that Sayyiduna Umar (may Allah be pleased with him) became the owner of one hundred shares at Khaybar, which he had bought. Then he came to the Messenger of Allah (peace and blessings be upon him) and said: "O Messenger of Allah! I have received property the like of which I have never received, and I intend to seek nearness to Allah through it." He (peace and blessings be upon him) said: "Retain the original property and dedicate the fruit in the path of Allah."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الوقف / 11904