Torture has been practiced throughout history. The Romans, Jews, Egyptians and many other cultures in history included torture as part of their justice system. Romans had crucifixion, Jews had stoning and Egyptians had desert sun death. All these acts of torture were considered necessary (as to deter others) or good (as to punish the immoral).
Medieval and early modern European courts used torture, depending on the accused’s crime and social status. Torture was deemed a legitimate meens to extract confessions or to obtain the names of accomplices or other information abbout a crime. Often, defendants already sentenced to death would be tortured to force them to disclose the names of accomplices. Torture in the Medieval Inquisition began in 1252 and ended in 1816 when a papal bull (formal statement by the Pope) forbade its use.
Universal prohibition against torture was realized only in the aftermath of WWII in 1948 and the UN Convention on Torture against Torture was adopted by the UN General Assembly considerably later in 1984.