A 600-foot footrace was the only athletic event at the first Olympics, a festival held in 776 B.C. and dedicated to Zeus, the chief Greek god.
For the next millennium, Greeks gathered every four years in Olympia to honor Zeus through sports, sacrifices and hymns. The five-day festival brought the Greek world together in devotion to one deity.
What began in ancient Greece as a festival to honor a single god, Zeus, has now become an almost Olympian task, as organizers of the games navigate dozens of sacred fasts, religious rituals and holy days.
The London Olympics will try to accommodate religious athletes with 193 chaplains, a prayer room in every venue and a multifaith center in the Olympic Village.
Athletes at the ancient Olympics believed their training honored the gods, and victory was a sign of favor from a deity. As contests like wrestling, boxing, and horse racing were added to the Olympic roster, they supplemented devotional sacrifices, hymns, and ceremonies.
"The idea was that you were training to please Zeus. But part of the festival would be to visit the temple, visit the cult statues, making offerings, celebrating and seeing your family," said David Gilman Romano, a professor of Greek archaeology at the University of Arizona.
The combination of Greek sport and worship led the Roman Emperor Theodosius I, a Christian, to ban the Olympics in 393 A.D.
The Frenchman Pierre de Coubertin revived the Olympic Games in Athens in 1896 after excavations at Olympia renewed public interest in the athletics and pageantry of the Olympics.
Though not sectarian, the modern games began to take on their own quasi-religious rituals.
Coubertin borrowed ceremonies, hymns, and rituals from the ancient festival to shape a transcendent "Olympism," uniting all athletes. Some scholars today refer to his creation as a "civil religion."
"The civil religion was not so much the worship or devotion to the state, as it is often now understood," explained Joseph Price, a professor of religion at Whittier College in California who researches sport and religion. Devotion "was to the civitas, the human group that transcended a particular religion."
Over the years, the International Olympic Committee and host states introduced "new" symbols to bolster Olympism, said Stephen Mosher, professor of sport management and media at Ithaca College in New York.
Still, the modern games have touches from the ancient past.
Gold medals since 1928 have been imprinted with the image of Nike, goddess of victory. And though the torch relay existed in antiquity, it was not part of the ancient Olympics. "It was'invented' by the Nazis for the 1936 Berlin Games in an obvious attempt to connect the modern German state with the ancient Greek state," Mosher said.
Today, the IOC and host countries must tread lightly to accommodate modern religious expression in an often-hostile political climate.
Some situations present special challenges.
In 2008, Israeli President Shimon Peres received special housing accommodations at the Beijing opening ceremony so that he would not have to drive in a car on the Jewish Sabbath.
Peres will miss the opening this year, as the London Organizing Committee refused to make special accommodations.
Modern religious athletes also struggle with religious devotion and the Olympic schedule. Devout Jews and Christians must choose whether to compete on the Sabbath.
Muslim athletes face a particularly difficult choice as the Olympics fall during the Islamic holy month of Ramadan, when Muslims refrain from eating and drinking during the day.
Clerics in Egypt and the United Arab Emirates extended an exemption to their athletes, allowing them to make up their fast at a later time. Some athletes will take the exemption, while others will fast.
This Olympics marks a milestone for Muslim women as Saudi Arabia, Qatar, and Brunei will send female athletes to the games for the first time. They are the last Muslim countries to allow women to compete.
In this respect, the Olympics have advanced greatly since ancient times, when only male Greek citizens could watch and compete.
But Romano urges caution in comparing the ancient and modern games.
"There are many similarities, but there are also differences. And one of the biggest differences is religion."