Dogs are pretty smart and loyal. We have the video to prove it.
This happened on a beach in Turkey. A woman was playing fetch with her dog. While mom was distracted, her made a break for the ocean. The spaniel quickly ends playtime and lays down in front the baby, stopping the child from crawling into the water