The boy got into difficulties crossing the River Nith, at the rear of Cairn Avenue in Dumfries, on Friday.
He was pulled from the water by a 32-year-old woman who was sitting nearby and heard his shouts.
After being given first aid at the scene he was later taken to Dumfries and Galloway Royal Infirmary for a check up. Police said the boy was at no time unconscious, but the event could have been a tragic one.
Inspector Claire Walker, of the Loreburn Street Police Office, said: "Underwater currents, debris which you can get snagged on and even the temperature of the water are all very dangerous.
"We also urge parents to speak to their children about the dangers of going into open water."