When Queen Elizabeth II celebrated her diamond jubilee in 2012—marking a record-setting 60 years on the British throne—the UK and the Commonwealth erupted into a vast series of flag-strewn tea parties, colorful villages fetes, and Union Jack street parades. That might be how royal anniversaries are celebrated today, but journey back through history and the celebrations surrounding royal jubilees grow a little more unusual. And if you go far enough back in time—to the very earliest days of Ancient Egypt, in fact—then royal jubilees become very unusual indeed.

More than 5,000 years ago in Ancient Egypt, after a pharaoh had ruled over their kingdom for 30 years, the Egyptians observed a bizarre ritual called Heb-Sed.

The Heb-Sed Festival, or the Sed Jubilee as it is also known, was one of the oldest and longest-running rituals in Ancient Egyptian history. Records of it taking place have been unearthed dating from as far back as 3,000 BCE, and it is known to have continued to take place long into the Roman Empire’s conquest of Egypt in the 1st century BCE.

Although accounts of it are hazy and lost in time, Heb-Sed is believed to have been a fairly prolonged affair, often including numerous different stages and ceremonies in which the pharaoh would perform all kinds of ritualistic activities; from visiting temples to make offerings to the gods, to symbolically firing arrows towards the four corners of their kingdom, and being repeatedly crowned and re-crowned, in a range of contexts and locations. The precise content of the festival, however, was often left up to the pharaoh themselves, which ensured that no Heb-Sed was ever the same as any other. But each one always tended to take place during the month of Koiak—the fourth month of the Egyptian calendar, equivalent to what is now November, in the pharaoh’s jubilee year, coinciding with the annual flooding of the Nile. And what’s more, each year’s Heb-Sed always culminated in one of history’s most bizarre spectacles.

After all the preceding rituals and ceremonies had been carried out, the pharaoh would typically return to their grandest and largest palace. There, they would change into an extraordinary costume comprising a short kiltlike garment worn around the waist, with the tail of a bull or some similar creature attached to the back of it; and then be made to sprint around a specially constructed running track drawn up in the courtyard of their palace, cheered on by a large crowd of subjects, and observed by an audience of dignitaries and high priests.

Perhaps understandably, Egyptologists aren’t entirely clear as to the meaning of this strange footrace . Likely, it was originally intended as nothing more than a show of strength; a chance for the pharaoh to demonstrate their vitality and athleticism, and thereby prove their fitness and ability to continue reigning over their kingdom. (Indeed, the name Heb-Sed itself commemorates a jackal-headed deity believed to be related to the Egyptian god of power and war, which might imply that this ritual was intended as a demonstration of strength or vigor.)

Another theory, however, claims that the race was purely ceremonial or symbolic, and was merely meant to represent the pharaoh outrunning their old age. Another contention is that the race was intended to represent the pharaoh reaching out to all the corners of their kingdom, much like the arrows shot into the direction of Egypt’s four corners. Yet another suggestion is that the Heb-Sed race may have had a much more practical use. Perhaps if the pharaoh were not able to complete the course, then they were deemed no longer fit enough to rule and would be promptly sacrificed, to make way for a younger, more vigorous successor. Whatever its purpose, once a pharaoh had celebrated their first Heb-Sed—in the 30th year of their rule—they were expected to repeat the process every three years thereafter, right up until their death.

Whatever the meaning of the Heb-Sed ceremony was, there’s no doubt that it took place. Countless images of the kings and queens of Egypt running their Heb-Sed footrace have been found in documents and inscriptions over the decades, as have the makeshift royal running tracks themselves. The great step-pyramid of the pharaoh Djoser at Saqqara in northeast Egypt has an entire courtyard set aside for the king’s Heb-Sed course, dating back to more than 2,600 years BCE.