Mahakapi Jataka
The Mahakapi Jataka is one of the Jataka tales or stories of the former lives of the Buddha, when he was still a Bodhisattva, as a king of the monkeys

Story
The story runs that the Bodhisattva was born as a monkey, ruler over 80,000 monkeys. They lived at a spot near the Ganges and ate of the fruit of a great mango tree. King Brahmadatta of Benares, desiring to possess the mangoes, surrounded the tree with his soldiers, in order to kill the animals, but the Bodhisattva formed a bridge over the stream with his own body and by this means enabled the whole tribe to escape into safety. Devadatta, the jealous and wicked cousin of the Buddha, was in that life one of the monkeys and, thinking it a good chance to destroy his enemy, jumped on the Bodhisattva’s back and broke his heart. The king, seeing the good deed of the Bodhisattva and repenting of his own attempt to kill him, tended him with great care when he was dying and afterwards gave him royal obsequies. Depiction in Bharhut
In this jataka tale the Buddha, in a previous incarnation as a monkey king, self-sacrificingly offers his own body as a bridge by which his fellow monkeys can escape from a human king who is attacking them. A short section of the river, across which the monkeys are escaping, is indicated by fish designs. Directly below that, the impressed humans are holding out a blanket to catch him when he falls. At the very bottom (continuous narrative), the now recovered Buddha-to-be preaches to the king. Depiction in Sanchi
Down the panel of the relief from Sanchi (Stupa No1, Western Gateway) flows, from top to bottom, the river Ganges. To the left, at the top, is the great mango tree to which 
two monkeys are clinging, while the king of the monkeys is stretched across the river from the mango tree to the opposite bank, and over his body some monkeys have 
already escaped to the rocks and jungles beyond. In the lower part of the panel, to the left, is king Brahmadatta on horseback with his soldiers, one of whom with bow and arrow is aiming upwards at the Bodhisattva. Higher up the panel the figure of the king is repeated, sitting beneath the mango tree and conversing with the dying Bodhisattva, who, according to the Jataka story, gave the king good advice on the duties 
of a chief. 