Behind this neo-Gothic façade, however, lie layers of history stretching back nearly a thousand years. The church was originally founded around 1070 by Prince Vratislav II, who chose Vyšehrad as his permanent seat. He intended it as the burial place of his dynasty and removed it from the jurisdiction of the Prague bishopric, placing the chapter directly under Rome. After a fire in 1249, the Romanesque fabric of the building was replaced by a Gothic three-nave structure. Under Charles IV, the church was rebuilt once more and, at over 110 metres in length, became the largest sacred building in Prague at the time. The Baroque reconstruction of 1707–1729 was overseen by Francesco Maxmilián Kaňka to plans attributed to Giovanni Santini, though little of it survived the subsequent Gothic revival remodelling.
The interior of the basilica is richly adorned with Art Nouveau wall paintings; the pillars, walls and vaulting of the nave are covered with a cycle of saints and angels by František Urban and his wife Marie Urbanová-Zahradnická. The Chapel of St. Clement houses a Romanesque sarcophagus known as the Longinus Tomb, dating from the 11th–12th century, which is thought to be the burial place of a member of the Přemyslid dynasty. The basilica's treasury holds a permanent exhibition of gold and silver jewellery, fragments of precious textiles and liturgical objects belonging to the Vyšehrad chapter. Also preserved here is the relic of St. Valentine — the saint's shoulder blade in a precious reliquary — which Charles IV is said to have brought to Prague from Rome. In 2003, Pope John Paul II elevated the Vyšehrad chapter church to the rank of a papal minor basilica.