It is narrated from Ibn Umar (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) separated the two who invoked mutual cursing (li'an) and gave the boy to the woman.
Hadith Referenceمسند الإمام الشافعي / كتاب اللعان / 1341
It is narrated from Ibn Umar (may Allah be pleased with him) that during the time of the Prophet (peace be upon him), a man invoked li'an against his wife and then also disowned her child. So the Messenger of Allah (peace be upon him) separated the two and gave the child to the woman.
Hadith Referenceمسند الإمام الشافعي / كتاب اللعان / 1342