Jami` at-Tirmidhi, Book 21, Hadith 51 (In-Book) ⓘ
Narrated 'Uqbah bin 'Amir: "I said: 'O Messenger of Allah! We come across a people and they do not host us, and they do not give us our rights, and we do not take anything from them. So the Messenger of Allah said: 'If they refuse such that you can only take by force, then take.'" [Abu 'Eisa said:] This Hadith is Hasan. It has been reported by Al-Laith bin Sa'd from Yazid bin Abi Habib as well. This Hadith only means that they would go out for battles and they would pass a people among whom they would not find any food to buy for a price. So the Prophet told them: If they refuse to sell you, such that you have to take it forcefully, then take it. This is how the explanation has been related in some of the Ahadith. And it has been related that 'Umar bin Al-Khattab, may Allah be please with him, would order similarly.
حَدَّثَنَا قُتَيْبَةُ، حَدَّثَنَا ابْنُ لَهِيعَةَ، عَنْ يَزِيدَ بْنِ أَبِي حَبِيبٍ، عَنْ أَبِي الْخَيْرِ، عَنْ عُقْبَةَ بْنِ عَامِرٍ، قَالَ قُلْتُ يَا رَسُولَ اللَّهِ إِنَّا نَمُرُّ بِقَوْمٍ فَلاَ هُمْ يُضَيِّفُونَا وَلاَ هُمْ يُؤَدُّونَ مَا لَنَا عَلَيْهِمْ مِنَ الْحَقِّ وَلاَ نَحْنُ نَأْخُذُ مِنْهُمْ . فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " إِنْ أَبَوْا إِلاَّ أَنْ تَأْخُذُوا كَرْهًا فَخُذُوا " . قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ حَسَنٌ . وَقَدْ رَوَاهُ اللَّيْثُ بْنُ سَعْدٍ عَنْ يَزِيدَ بْنِ أَبِي حَبِيبٍ أَيْضًا . وَإِنَّمَا مَعْنَى هَذَا الْحَدِيثِ أَنَّهُمْ كَانُوا يَخْرُجُونَ فِي الْغَزْوِ فَيَمُرُّونَ بِقَوْمٍ وَلاَ يَجِدُونَ مِنَ الطَّعَامِ مَا يَشْتَرُونَ بِالثَّمَنِ فَقَالَ النَّبِيُّ صلى الله عليه وسلم " إِنْ أَبَوْا أَنْ يَبِيعُوا إِلاَّ أَنْ تَأْخُذُوا كَرْهًا فَخُذُوا " . هَكَذَا رُوِيَ فِي بَعْضِ الْحَدِيثِ مُفَسَّرًا وَقَدْ رُوِيَ عَنْ عُمَرَ بْنِ الْخَطَّابِ رضى الله عنه أَنَّهُ كَانَ يَأْمُرُ بِنَحْوِ هَذَا .
also referenced under: Hadith 1589 (Reference) & Volume 3, Book 19, Hadith 1589 (DarusSalam)