The first occasion on which we read of a prison is in the history of Joseph in Egypt. Then Potiphar, "Joseph's master, took him, and put him into the prison, a place where the king's prisoners were bound" (Genesis 39:20-23). The Hebrews word here used (sohar) means properly a round tower or fortress. It seems to have been a part of Potiphar's house, a place in which state prisoners were kept.
The Mosaic law made no provision for imprisonment as a punishment. In the wilderness two persons were "put in ward" (Leviticus 24:12; Numbers 15:34), but it was only till the mind of God concerning them should be ascertained. Prisons and prisoners are mentioned in the book of Psalms (69:33; 79:11; 142:7). Samson was confined in a Philistine prison (Judges 16:21, 25). In the subsequent history of Israel frequent references are made to prisons (1 Kings 22:27; 2 Kings 17:4; 25:27, 29; 2 Chronicles 16:10; Isaiah 42:7; Jeremiah 32:2). Prisons seem to have been common in New Testament times (Matthew 11:2; 25:36, 43). The apostles were put into the "common prison" at the instance of the Jewish council (Acts 5:18, 23; 8:3); and at Philippi Paul and Silas were thrust into the "inner prison" (16:24; Comp. 4:3; 12:4, 5).