The first place where the camel chose to sit was a dates-drying area which belonged to orphans. Upon inquiry, Rasulullah (sallallahu ‘alaihi wasallam) learnt that this plot of land belonged to two orphans named Sahl and Suhail.
Rasulullah (sallallahu ‘alaihi wasallam) called both of them and requested them to sell the land to him for the purpose of erecting a musjid. Rasulullah (sallallahu ‘alaihi wasallam) also spoke to the uncle of the two orphans, in whose care they were, about purchasing the land. Both of them expressed the desire to donate the land to Rasulullah (sallallahu ‘alaihi wasallam) without any compensation, saying that they hoped to reap the reward from Allah Ta‘ala alone.
However, Rasulullah (sallallahu ‘alaihi wasallam) declined to accept it without any remuneration, and he therefore paid them for the land.
In the narration of Imaam Zuhri (rahimahullah), it is mentioned that Rasulullah (sallallahu ‘alaihi wasallam) instructed Hazrat Abu Bakr (radhiyallahu ‘anhu) to pay for the plot of land. In another narration, it is mentioned that Hazrat Abu Bakr (radhiyallahu ‘anhu) paid ten dinaars (gold coins) as the price for the land.
(Extracted from Seeratul Mustafa 1/245)