In 1777, seven commissioners were appointed to purchase a plot of land not exceeding four acres, for building a court house and prison for Montgomery County. In 1777, both court and jail were located in the former Hungerford Tavern on South Washington Street. The jail was in another location after 1779. Benjamin Ray provided stocks, a whipping post, and pillory for the jail in 1780. Between 1786 and 1789, Sheriff William Robertson used his new house at 101 South Washington Street for his office and jail, or "gaol." The present house replaced the Robertson house and jail in 1884.
In 1801, the County received funds to build a jail house at the site of the County Office Building on the east side of Maryland Avenue, then known as Perry Street. In 1807, Joseph Scott described "Montgomery Court House, erected by the General Assembly under the name Rockville," saying, "The public buildings are a brick court-house, and jail, without either taste or elegance." This jail burned in 1861 and the two-story stone building pictured was built in 1862. The jailer, Mr. Trail, lived there with his family. The jail capacity was 20 inmates. There was a large yard behind the building where the last hanging in the county occurred on April 15, 1921. This jail was used until the new grey courthouse was built in 1931 with jail cells on the top floor. The old jail was demolished at this time.