The Messenger of Allah ﷺ said, "Whoever takes a binding oath in order to seize the property of a Muslim by it will meet Allah while He is angry with him."Then Allah revealed confirmation of this, "Indeed, those who exchange the covenant of Allah and their oaths for a small price will have no share in the Hereafter" [Aal Imran 3:77], to the end of the verse.The narrator said, Ashath bin Qays then entered and asked, "What is Abu Abdul-Rahman telling you?"They replied, "Such and such."He said, "It was revealed concerning me. I had a well on the land of a cousin of mine."The Prophet ﷺ said, "Your evidence, or his oath."I said, "In that case, he will swear an oath about it, Messenger of Allah."The Prophet ﷺ then said, "Whoever takes a binding oath in order to seize the property of a Muslim by it, while being a liar in it, will meet Allah while He is angry with him."
قال رسول الله ﷺ: من حلف على يمين صبر يقتطع بها مال امرئ مسلم لقي الله وهو عليه غضبان فأنزل الله تصديق ذلك: {إن الذين يشترون بعهد الله وأيمنهم ثمنا قليلا أوليك لا خلق لهم في الآخرة} إلى آخر الآية. قال: فدخل الأشعث بن قيس وقال: ما يحدثكم أبو عبد الرحمن؟ فقالوا: كذا وكذا، قال: في أنزلت، كانت لي بئر في أرض ابن عم لي، قال النبي ﷺ: بينتك، أو يمينه فقلت: إذا يحلف عليها يا رسول الله، فقال النبي ﷺ: من حلف على يمين صبر يقتطع بها مال امرئ مسلم وهو فيها فاجر لقي الله وهو عليه غضبان.
Bukhari narrated it in the tafsir (4549-4550) and Muslim in the book of faith (138), both of them via Amash, from Abu Waail, from Abdullah bin Masud, and he related it, and the wording is Bukhari's.