Peter and the other apostles were imprisoned by order of the high priest and were freed from prison by an angel.
But the high priest rose up, and all who were with him (that is, the party of the Sadducees), and filled with jealousy they arrested the apostles and put them in the public prison. But during the night an angel of the Lord opened the prison doors and brought them out, and said, “Go and stand in the temple and speak to the people all the words of this Life.” And when they heard this, they entered the temple at daybreak and began to teach.
Peter was imprisoned again when King Herod began persecuting the church.
About that time Herod the king laid violent hands on some who belonged to the church. He killed James the brother of John with the sword, and when he saw that it pleased the Jews, he proceeded to arrest Peter also.