Since the establishment of the British Army in the 1600s, policing and punishment of soldiers was overseen by a Provost Marshal, with prisoners often being sent to civilian jails.
In the late 1800s, formal army prisons were being constructed. A review in 1895 recommended a dedicated unit needed be set up to oversee discipline, staffing of these prisons and, ultimately, the wellbeing of those being held there.
In 1901, the Military Provost Staff Corps was created to fulfil that role, and continued to do so until 1966, when the last military prison was closed.

Commonwealth War Graves