5 So Peter was kept in prison, but the church was earnestly praying to God for him.

Read Acts 12:5 Using Other Translations

Peter therefore was kept in prison: but prayer was made without ceasing of the church unto God for him.
So Peter was kept in prison, but earnest prayer for him was made to God by the church.
But while Peter was in prison, the church prayed very earnestly for him.