The Jataka tales are a collection of stories about the Buddha's previous lives, in which he appears in many forms, human, animal, spirit, each time working out a quality the tradition considers worth cultivating. One of the most retold is the story of the monkey king, known in Pali as the Mahakapi Jataka.
In that story, a great monkey king rules a tribe living in a mango tree beside the Ganges. When a human king discovers the tree and covets its fruit, the monkey king realises his tribe must flee. The only escape is across the river. There is no bridge. So the monkey king stretches his own body between two branches, gripping one with his hands and the other with his feet, and tells his tribe to run across his back. They do. Every one of them crosses safely. By the time the last monkey has gone, the king's body is broken. He dies on the far bank.