Originally St Peter-without-Trumpington-Gate, the church and its endowments were made over to scholars lodged in houses south of the churchyard by Hugh of Balsham, Bishop of Ely, in 1284. This marks the foundation of Peterhouse, the first Cambridge college. It was rebuilt c.1350, and dedicated to St Mary of Grace in 1352. In 1632, when a new Peterhouse chapel was consecrated, St Mary's was made over largely for parish use, although Fellows of Peterhouse continued to serve as ministers until the 19thc., and the college is still the patron of the living.