The insanity defense was first discussed in an American court case in the early 20th century.