St. Andrew's Church in Ayer, Massachusetts was first organized in October 1889 when the Rev. Dr. Endicott Peabody, headmaster of nearby Groton School, assigned one of its masters, the Rev. William G. Thayer, to begin the work of founding an Episcopal mission. The present attractive stone church was completed in December 1892. The next minister was the Rev. Charles L. Slattery, also a master at Groton School, who had the satisfaction of leaving St. Andrew's Church debt-free and consecrated. He was succeeded by the Rev. Edward H. Newbegin.
The Rev. Dr. Endicott Peabody, headmaster at Groton School, was in Rev. Thayer's words, "the father of the thought," and his support and cooperation for the many years until his retirement in 1940 were largely responsible for the existence and continuance of the church.
On the 27th day of January 1898, the Bishop and Standing Committee having given their consent, St. Andrew's Mission, Ayer, was duly and legally organized as St. Andrew's Parish in Ayer and Groton and the minister, the Rev. Edward H. Newbegin, was elected rector.
The parish was reorganized in June 1901 before its admission to the Diocesan Convention, comprising the mother church at Groton School, the parish church in Ayer, the mission house at Forge Village, the schoolhouse mission at Woodsville, and also the care of Trinity Chapel in Shirley Center. By this consolidation, Groton School became a real part of the parish; its headmaster, the Rev. Dr. Endicott Peabody, became rector; and the rector in Ayer, the Rev. Thomas L. Fisher, became the vicar of the parish.
The year 1950 marked the end of the official connection between Groton School and St. Andrew's Church and the vicar, the Rev. Henry Mattocks, became rector of the parish. In September 1960, St. Andrew's gave up oversight of the mission at Forge Village. It subsequently became an independent parish, now called St. Mark's Church in Westford, Massachusetts.