When he saw that this pleased the Jews, he went ahead and had Peter arrested. (This happened during the time of the Festival of Unleavened Bread.)
After his arrest Peter was put in jail, where he was handed over to be guarded by four groups of four soldiers each. Herod planned to put him on trial in public after Passover. 1
References for Acts 12:4
12.4 Ex 12.1-27.
So Peter was kept in jail, but the people of the church were praying earnestly to God for him.
The night before Herod was going to bring him out to the people, Peter was sleeping between two guards. He was tied with two chains, and there were guards on duty at the prison gate.
Suddenly an angel of the Lord stood there, and a light shone in the cell. The angel shook Peter by the shoulder, woke him up, and said, "Hurry! Get up!" At once the chains fell off Peter's hands.
Then the angel said, "Tighten your belt and put on your sandals." Peter did so, and the angel said, "Put your cloak around you and come with me."
Peter followed him out of the prison, not knowing, however, if what the angel was doing was real; he thought he was seeing a vision.
They passed by the first guard station and then the second, and came at last to the iron gate that opens into the city. The gate opened for them by itself, and they went out. They walked down a street, and suddenly the angel left Peter.
Then Peter realized what had happened to him, and said, "Now I know that it is really true! The Lord sent his angel to rescue me from Herod's power and from everything the Jewish people expected to happen."
Aware of his situation, he went to the home of Mary, the mother of John Mark, where many people had gathered and were praying.
Peter knocked at the outside door, and a servant named Rhoda came to answer it.