Following public concern over an increase in prostitution and venereal disease, reflecting the rapid rise in population, urban living and increased mobility, Parliament passed the Contagious Diseases Act in 1864 (amended in 1866 and 1869). The act was specifically targeted at ports and garrison towns with, unsurprisingly, Chatham qualifying as both. The objective of the Act was to reduce venereal disease that, in addition to its implications for personal and social health, was also affecting the efficiency of the armed services. The Act empowered policemen to arrest suspected prostitutes and take them to police stations, where they were subjected to what was often a forcible examination. These examinations, exclusively carried out by male physicians, had to determine whether or not venereal disease was present. If this was shown to be the case, then the legislation permitted the unfortunate woman to be taken to a Lock Hospital – so called because the patients were locked up - where she would be detained until cured, a process that could take months. Many women who were arrested and subjected to a painful examination were not prostitutes, and this Act therefore put innocent women at risk of public humiliation and disgrace.

Chatham’s purpose built Lock hospital was constructed in 1869, and was used to treat those arrested under the Act from Chatham, Gravesend, Maidstone and Sheerness. The use of the Lock Hospital reduced prostitution in these towns, although this reduction coincided with increased police observation of suspected brothels.

The Act, which had no provision for sanctions against men who used prostitutes, was seen as discriminatory towards women by campaigners such as Josephine Butler and Sarah Grand, although Elizabeth Garrett Anderson, the first English female physician agreed with the Act as a means of protecting women and children. The Act was finally repealed in 1886.