Officers were alerted to the case of a missing child in the Sarn area at 5.45am on Saturday.
The child was discovered in the Ogmore River near Pandy Park and rushed to Princess of Wales Hospital where he was pronounced dead.
His family is being supported by specially trained officers, police said.
South Wales Police have launched an investigation into his death and are looking to hear from anyone who was in the area at or around 5.45am on Saturday, or who may have information about how the child ended up in the water.
Chief Inspector Geraint White said: “This is a tragic incident in which a young child has sadly lost their life.
‘” We are appealing for anyone who may have witnessed this incident, or who has any information, to get in touch.
“We would ask the public not to speculate about this incident on social media as this is an active investigation.
“If you have any information that can help, please report this to us.
“Our thoughts are with the family and we are supporting them in every way we can.”
Anyone with information can phone 101 and use the reference number 2100268674.