Sahih al-Bukhari 2564
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
اشْتَرِيهَا وَأَعْتِقِيهَا، فَإِنَّمَا الْوَلاَءُ لِمَنْ أَعْتَقَ "
Narrated `Amra bint `Abdur-Rahman:
Buraira went to Aisha, the mother of the faithful believers to seek her help in her emancipation Aisha said to her, "If your masters agree, I will pay them your price in a lump sum and manumit you." Buraira mentioned that offer to her masters but they refused to sell her unless the Wala' was for them. `Aisha told Allah's Messenger (ﷺ) about it. He said, "Buy and manumit her as the Wala' is for the liberator."
Full reference and source
Sahih al-Bukhari 2564 In-book : Book 50, Hadith 5 USC-MSA web (English) : Vol. 3, Book 46, Hadith 738 (deprecated)
View source on Sunnah.com (opens in a new tab)