In 1567, a group of nuns of the Order of Santa Clara occupied the hermitage, rebuilding the badly-decayed building; however they abandoned the site only ten years later. The tailors' guild retook possession of the property and decided to make themselves into a more formal religious organization, affiliated with the Trinitarians. Around the same time in 1577, Pedro Gutierrez Pisa founded the Brotherhood of Saint Peter to establish a hospital–hospice dedicated to ill and old clergy. This clerical organization joined with the Trinitarians to gather the necessary resources, leading to the establishment of the Cofraternity of the Most Holy Trinity (Archicofradía de la Santísima Trinidad) which had four principal missions: bury the dead, visit the sick, evangelize and give lodging to pilgrims. Building of the first church and hospital began in 1580, but the church was not consecrated until 19 September 1667. By 1735, the original church and sacristy had decayed badly. It was closed in 1754 by decree of the archbishop, so that a new church could be built in its place. Construction began the following year and the new church was consecrated in 1783. The instability of the ground beneath Mexico City has caused serious problems for the church over time. In 1805–06, the floor of the church was raised to correct a flooding problem during the rainy season, but the problem returned and worsened until it forced the closing of the church for major repairs from 1855 to 1858. In the 1860s, the building began to tilt to the south, prompting the placement of a stone wedge to keep this problem from getting worse. In 1924, it was estimated that the current church building had sunk 2.85 meters since it was built. The sunken and hidden original foundations were excavated in 1980. A square was recently created here to help stop the subsidence of the church. The temple and hospital were closed in between 1859 and 1861 due to the Reform Laws. In 1859, the offices were separated from the church and parts of it were sold to private hands. Part of the hospital was ceded to the Lancasteriana Schools, which were nationalized in 1890, so this part of the hospital became government offices. By 1936, these offices were sold into private hands. The church was declared a national monument in 1932 as well as parts of the remaining hospital building.