St Mary’s Church of Ireland is, curiously, incorporated into the outer wall of St Patrick’s College, and was originally built as a private chapel for the castle. In 1248, it was made a Prebend of St Patrick’s Cathedral in Dublin. In the 17th century St. Mary’s became a Protestant Church when the 16th Earl of Kildare was brought up a Protestant. The church was extensively renovated by Richard Boyle, Earl of Cork, George Fitzgerald’s father-in-law, in the 1630′s as part of his rebuilding of the castle. Shortly afterwards, however, during the wars of the 1640′s both the castle and the church fell into ruins. In 1770, James, the first Duke of Leinster who had earlier constructed Leinster House in Dublin, repaired St. Mary’s church and made it available for the use of the parish. The back of the church and churchyard contains fragments of the medieval curtain wall of the castle. The 15th century tower is a mausoleum for the third Duke and Duchess of Leinster. The organ is small, but of great historical importance, being one of very few untouched Telford instruments remaining in the country. The organ dates from around 1820.