It is narrated from Sha'bi (may Allah have mercy on him) who states that a man came to Ali (may Allah be pleased with him) and said: I have found fifteen hundred dirhams in an uninhabited place in the region of Sawad. Ali (may Allah be pleased with him) said: I will give a very clear ruling on this. If you found it in such an uninhabited place that is adjacent to another settlement, then this money belongs to the people of that settlement. And if you found it in such a settlement whose uninhabited area is not adjacent to another, then four-fifths are for you and one-fifth is for us, then another fifth is for you.
Hadith Referenceمسند الإمام الشافعي / كتاب الزكاة / 731
Hadith Takhrijاسناده صحیح اخرجه البيهقي : 4 / 156 ۔ وفى المعرفة السنن والآثار له (2391) وابن ابی شیبة (10772)۔