Sahih al-Bukhari, Book 86, Hadith 71 (Bukhari 6596)

Narrated `Abdur-Rahman bin Jabir:

On the authority of others, that the Prophet (ﷺ) said, "No Punishment exceeds the flogging of the ten stripes, except if one is guilty of a crime necessitating a legal punishment prescribed by Allah."