The construction of the church started as a part of a Premonstratensian monastery. It was the third consecutive church standing at the same site.The construction was completed in the 13th century. It was a private family church (German: Geschlechterkirche), built by a single family, the gens Smaragd (the family of Aynard), and might have been the last of such churches in Hungary. The church was a three-nave basilica; the cloister was attached to one of the sides.In 1398, the Aynards went out of favor and the king ordered their property to be confiscated. Zsámbék was transferred to the Maróthi family, and in 1477, when these became extinct, Matthias Corvinus transferred the monastery to the Pauline Fathers. The church and the monastery were subsequently rebuilt in the Gothic style.