It is narrated from Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "Some people of my Ummah will recite the Qur'an and go deep into the religion, splitting hairs. (At that time) Satan will come to them and say: 'Why do you not go to the kings and obtain something of their worldly wealth, while keeping yourselves apart from them with your religion?' Beware! That can never be. Just as nothing can be picked from the qatad (a thorny tree) except thorns, likewise nothing is gained from closeness to them (the kings) except sins."
Imam al-Tabarani (may Allah have mercy on him) said: "Hisham bin Ammar is alone in narrating this hadith." (But Imam Diya al-Din al-Maqdisi (may Allah have mercy on him) says:) That is not so, for Imam Ibn Majah (may Allah have mercy on him) narrated it from Muhammad bin al-Sabbah, from al-Walid bin Muslim, with the like of it.
Related hadith on this topic