Allah's Messenger (ﷺ) took as a loan (the rest of the hadith is the same), but with this variation that he (the Holy Prophet) said: Good amongst the servants of Allah is he who is best in paying off the debt.
Sahih Muslim Book 22, Hadith 148