He was famous for his piety and integrity and courageously stood up, and was prepared to suffer, for his convictions. For example, when the governor of Medina demanded and forced people to take the oath ofÂ allegiance to Khalifa al-Mansour, Imam Malik issued a Fatwa that such an oath was not binding, because it was given under duress. This resulted in many people finding courage to express their opposition, but the Imam was arrested, found guilty of defiance and publicly flogged. When al-Mansour, learnt of this outrage, he apologized to the Imam and dismissed the governor. Sometime later the Khalifa sent him three thousand Dinars for his travelling expenses and invited him to come and reside in Baghdad. Imam Malik refused the offer and indicated that he preferred to continue his residence in Medina where the Holy Prophet was buried.
When the Khalifa Haroun-al-Rasheed visited Medina when he came to perform Hajj, he summoned him to visit him and deliver a lecture. The Imam politely refused to go to the ruler but invited him to attend the class of students to whom he delivered regular lectures. The Khalifa, accompanied by his two sons, accepted the invitation and sat among the students to hear the Imam's lecture.