It is believed that the church is near the original Hammaburg area and that previous cathedral existed on the site. St. Peter's was probably built at the start of the 1189; it was first documented in 1195 as a market cathedral or ecclesia forensis. In about 1310, the cathedral was rebuilt in a Gothic style and was completed in approximately 1418. The bronze lion-head door handles, the oldest work of art of Hamburg, date from the foundation of the tower in 1342.
A second tower, built in 1516, towered above even the Hamburg Cathedral. Decay caused it to be torn down between 1804 and 1807, after it had been used by Napoleonic soldiers as a horse stable. The building fell victim to the great fire that swept Hamburg in May 1842. Most works of art, such as the lion-head door handles, were saved. The St. Peter's portal gateway was heavily damaged in the fire but was saved and ended up being built into the Museum für Hamburgische Geschichte (established in 1922 and called Hamburg Museum since 2005), and the doorway itself was restored again in 1995.
Only seven years after the great fire, the Gothic church was rebuilt by architects Alexis de Chateauneuf and Hermann Felsenfest in its previous location. In 1878, the 132 meter high cathedral tower—its copper spire designed by Johann Maack—was finished.