Jafar the son of Sulayman was the Abbasid (descendants of Abbas) governor of Madinah.
Jafar flogged Imam Malik, to the point that they knocked him out cold. He was then carried outside in this state and was set up on a donkey to be paraded around Madinah.
As soon as Imam Malik woke up and saw himself in this state, he cried out,
“I bear witness to you (Jafar) that I have made my beating a lawful act for you (so you are not punished)!”
Later on, people asked Imam Malik about this and he said,
“I was afraid of dying and meeting the Prophet with the shameful knowledge that one of his family members could enter the Fire because of what he did to me.”
When, al-Mansur was told of what happened he told Imam Malik to take retaliation on Ja’far, but Imam Malik refused, saying to him,
“I seek refuge in Allah! Every time the whip left my body I made it lawful because of his kinship to the Messenger of Allah.”
—Originally posted by Ustadh Luqman al-Andalusi