This story borrows the plot and elements from the Sherlock Holmes story The Illustrious Client by Sir Arthur Conan Doyle, right down to the acid thrower get a taste of his own medicine.
This episode appears to be based on the 1996-1997 Kelly Anne Bates case. Bates was an English teenager who was murdered in Manchester, England at the age of 17 by her abuser, James Patterson Smith. She was tortured by him over a period of four weeks, including having her eyes gouged from their sockets up to three weeks before her death, before being drowned in a bathtub. The murder inquiry was headed by Detective Sergeant Joseph Monaghan of Greater Manchester Police, who said: "I have been in the police force for 15 years and have never seen a case as horrific as this." William Lawler, the pathologist who examined Bates' body, described her injuries as the worst he had seen on a murder victim. Smith, who had a history of violence and torture against former sexual partners, denied murdering Bates, but was convicted and sentenced to life imprisonment on 19 November 1997.