Sahih al-Bukhari, Book 86, Hadith 72 (Bukhari 6597)

Narrated Abu Burda Al-Ansari:

I heard the Prophet (ﷺ) saying, "Do not flog anyone more than ten stripes except if he is involved in a crime necessitating Allah's legal Punishment."