Sunan an-Nasa'i, Book 44, Hadith 209 (Nasa'i 4667)

it was narrated from 'Abdullah that:

the Messenger of Allah forbade selling loyalty or giving it away.