The gaol was a colonial prison building for York County, Maine and served as a jail from 1719 to 1879.