Whenever signs of heresy flared up in a given region, or whenever a complaint was made about heretics by neighbors of a suspect, inquisitors were sent by the pope to investigate. These were usually Franciscan or Dominican friars, known for their extreme piety. Working in cooperation with local bishops, inquisitors would call for anyone with knowledge of ongoing heresy to come forward and testify. When heretics were uncovered, they were given a chance to repent and return to the fold; those who stuck by their heretical views could be excommunicated or, in later centuries, turned over to the secular authorities for execution.
Initially, the use of torture to obtain confessions or the names of conspirators was rejected, but in 1252 it was authorized by Innocent IV. In the 13th and 14th centuries, a series of manuals was written by experienced inquisitors to guide newcomers. The most famous of these is Practica inquisitionis heretice pravitatis (The Conduct of Inquiry Concerning Heretical Depravity) by Bernard Gui.
Medieval inquisition was most common in Italy and France. In the 15th century, Pope Sixtus IV authorized inquisition in Spain, then failed to stop the abuses of inquisitorial power. A Roman Inquisition was established in the 16th century to combat Protestantism; alternating between lenience and severity, it eventually evolved into an ordinary department of the papal government. The word "inquisition" was dropped when the Roman Curia was reorganized in 1908.
The abuses of power committed by the inquisitors in Spain were as unexpected as the pope's inability to curtail them.
Nobody expects the Spanish Inquisition!