When Safavi came to power, a centralized government with Shiite religion and legal system based on Imami jurisprudence was established in Iran. Ensuring the security of the country, protecting the life of the ruler, and the survival of the government were among the main concerns of the Safavi. Qahqaheh Prison, as one of the institutions used to ensure security during this period, was of particular importance. The main question of the present study is what position Qahqaheh Prison and the rights of its residents had in the criminal justice system of the Safavi era and to what extent it was influenced by the teachings of Shiite-Islamic jurisprudence. This article, using a historical method and a descriptive-analytical approach based on the contents of primary sources and reliable historical research, has reached the following findings: Safavi historical sources about Qahqaheh Prison and its residents mostly recorded information related to the upper class, such as princes. Also, the Safavid judicial structure was mostly derived from the judicial institutions of the Mongol, Timurid, Qaraquyunlu and Aqqyunlu Turkmen governments, and was partly influenced by the policies of the Safavi kings. During this period, prison was not considered a type of main punishment, but rather a place for taking revenge, incapacitation, keeping away from society, gradual death or murder of opponents and enemies of the Safavi government, and the prison conditions and rights of individuals imprisoned in Qahqaheh had little compliance with the teachings of Shiite-Islamic jurisprudence.