Sahih Bukhari Volume 9, Book 86, Hadith Number 107.

Narrated By ‘Amr bin Ash-Sharid : Al-Miswar bin Makhrama came and put his hand on my shoulder and I accompanied him to Sa’d. Abu Rafi’ said to Al-Miswar, “Won’t you order this (i.e. Sa’d) to buy my house which is in my yard?” Sa’d said, “I will not offer more than four hundred in installments over a fixed period.” Abu Rafi said, “I was offered five hundred cash but I refused. Had I not heard the Prophet saying, ‘A neighbor is more entitled to receive the care of his neighbor,’ I would not have sold it to you.” The narrator said, to Sufyan: Ma’mar did not say so. Sufyan said, “But he did say so to me.” Some people said, “If someone wants to sell a house and deprived somebody of the right of preemption, he has the right to play a trick to render the preemption invalid. And that is by giving the house to the buyer as a present and marking its boundaries and giving it to him. The buyer then gives the seller one-thousand Dirham as compensation in which case the preemptor loses his right of preemption.”

Narrated ‘Amr bin Ash-Sharid: Abu Rafi’ said that Sa’d offered him four hundred Mithqal of gold for a house. Abu Rafi ‘ said, “If I had not heard Allah’s Apostle saying, ‘A neighbor has more right to be taken care of by his neighbor,’ then I would not have given it to you.” Some people said, “If one has bought a portion of a house and wants to cancel the right of preemption, he may give it as a present to his little son and he will not be obliged to take an oath.”