The sutta sets the prophecy inside a long account of moral and social decline and renewal. As people abandon right conduct, the text says, human life spans shrink across generations toward a violent low point of about ten years, followed by a brief "sword interval" of general slaughter; a remnant of survivors then resolves to recover virtue, and life spans climb back up across further generations, doubling and redoubling until they reach eighty thousand years. It is at that high point, when conditions of prosperity and ease make the teaching easiest to hear, that both a righteous wheel-turning monarch named Sankha and a new buddha become possible at once.
The Buddha names his successor directly: a Blessed One named Metteyya will arise in the city of Ketumati, "endowed with wisdom and conduct, a well-farer, knower of the worlds, teacher of gods and humans, enlightened and blessed, just as I am now." Sankha, ruling as a conqueror of the four quarters by righteousness rather than force, will restore an ancient palace, give it away to ascetics and the destitute, then shave his head, put on the yellow robe and go forth from the household life as one of Metteyya's own followers. The king renouncing his throne to sit at the new buddha's feet is the sutta's image of what the golden age of eighty thousand years is actually for.
Maitreya is the only future buddha both Theravada and Mahayana traditions accept, and this passage is the shared textual root of that expectation, predating the sectarian split between them.