From Sahih Bukhari (Hadith 4748):
Narrated Ibn `Umar:A man accused his wife of illegal sexual intercourse and denied his paternity to her (conceived) child during the lifetime of Allah's Messenger (ﷺ). Allah's Messenger (ﷺ) ordered them both to do Mula'ana as Allah decreed and then gave his decision that the child would be for the mother, and a divorce decree was issued for the couple involved in a case of Mula'ana
Reference: Bukhari 4748