This originally Romanic church is the oldest church in the Lesser Town. After its establishment it was given as a gift from King Vladislav II. to the crusader Order of Johannites, the later Knights of St John, who built a fortified Komenda with the monastery, the hospital and the church at the end of the Judith’s Bridge. The picture on the main altar, by Karel Škréta, portrays the Madonna blessing the Johannites in the naval battle of Lepanto in 1571, where the Crusaders famously defeated the Turkish.
Because of its unsatisfactory size, the church was rebuilt in the Gothic period. Before the Hussite wars they managed to build Gothic towers and a portico but there was no time to build the nave of the church. Some parts of the original Romanic church were torn down. The next adjustments were designed by Carl Lurag in the Baroque style in the late 16th century. In the middle of the 19th century, the church was completed in the Neo-Gothic style. The gradual finishing of the church caused an architectonic disharmony. The church is actually just a fragment of originally intended Gothic cathedral. The church was important because of its strategic location, where it was right next to the Stone Bridge. The gate of the bridge was locked with the chain during the night, thus, the unusual name of the church. The Chapel of St. Jan Nepomucký on the north part of the nave resembles the place where the Vicar General of the Archbishop was arrested. Later, he was interrogated by King Václav to the point where he died while being tortured. His body was thrown into the river from the Stone Bridge, which resembles one of the statues on the Charles Bridge.