The construction of the first basilica was begun by Saint Helena, the mother of the Emperor Constantine I, in AD 327 and was completed in Ad 333. That structure was burnt down in the Samaritan Revolt of AD 529. The current basilica was rebuilt in Ad 565 by the Emperor Justinian I. When the Persians invaded in AD 614, they did not destroy the structure, because, according to legends, their commander Shahrbaraz was moved by the depiction inside the church of the Three Magi wearing Persian clothing. So he ordered that the building be spared. The Crusaders made repairs and additions to the building during the Latin Kingdom of Jerusalem with permission and help given by the Byzantine Emperor. Over the years, the compound has been expanded. Currently it covers about 12,000 square meters. Now the church is administered jointly by Roman Catholic, Greek Orthodox and Armenian Apostolic authorities, all of them maintaining monastic communities on the site.
The church was one of the direct causes for French involvement in the Crimean War against Russia.