Robert Hightower (John Wayne), William Kearney (Harry Carey Jr) and Pedro Roca Fuerte are 3 bank robbers on the run from a posse through the desert in Arizona. They come across a covered wagon, belonging to some incompetent settlers coming west. The settlers ran out of water. The husband is dead, and the cattle scattered. The wife is barely alive, and is in labor. They assist her. When the baby is born, she names him Robert William Pedro, and asks the 3 to be his godfathers. She asks them to promise to take him to safety and see that he is raised properly.
The 3 head for the nearest town with the baby, but it is far away, through a hostile desert with no water. They reserve their small water supply for the baby. First William, and then Pedro, die of dehydration and heat stroke. Robert makes it to the town of New Jerusalem with the baby, where he is promptly arrested by Sheriff Perley Sweet (Ward Bond). They realize the baby is the sheriff's grandson, as his daughter and son in law were coming to live by them. The sheriff becomes a friend and supporter of Robert.
In the trial, Robert is found guilty of the bank robbery. Because he gave himself up to bring the baby to safety, the judge will let him go free if he promises to never enter Arizona again. Robert refuses, saying that he can not break a promise to a dying lady and must watch to see that the baby is raised right. The judge says it was a test, and because of Robert's devotion to the baby he will get only the minimum sentence, and can then live there.
Thanks Joseph C!