All four of the gospels Matthew, Mark, Luke, and John recorded the event of Peter denying Christ three times before the cock crowed and each version varies slightly but the basic outline is there in all of them. Christ warned Peter that he would deny Him three times before the cock crowed and Peter insisted he would not ever deny Christ and would rather die with Him than deny Him, as did the other disciples. When Peter was confronted and accused of being one of Christ's followers (while Jesus was being tortured), Peter feared for his own life and Peter did in fact, (vehemently) deny Christ three times before the cock crowed. After Peter heard the rooster crow, he remembered Jesus's warning and Peter wept.
Jesus warned His disciples that they would be offended by people on this particular night and Peter spoke up right away to contradict what Jesus said by saying he (Peter) would not get offended and would never be offended. Jesus told Peter that on that very night he (Peter) would deny even knowing him and Peter firmly denied it saying he would rather die with Christ rather than deny Him. All of the other disciples said the same. In all four accounts in Matthew, Mark, Luke, and John Peter's denial and the cock crowing was the same but there are differences in each version as to who actually accused Peter of being with Christ, being a follower of Him and a disciple of Him. Matthew's version of Peter's denial:
Matthew 26:30 And when they had sung an hymn, they went out into the mount of Olives.
Matthew 26:31 Then saith Jesus unto them, All ye shall be offended because of me this night: for it is written, I will smite the shepherd, and the sheep of the flock shall be scattered abroad.
Matthew 26:32 But after I am risen again, I will go before you into Galilee.
Matthew 26:33 Peter answered and said unto him, Though all men shall be offended because of thee, yet will I never be offended.
Matthew 26:34 Jesus said unto him, Verily I say unto thee, That this night, before the cock crow, thou shalt deny me thrice.
Matthew 26:35 Peter said unto him, Though I should die with thee, yet will I not deny thee. Likewise also said all the disciples.
Peter denied knowing Jesus three times. In spite of his protests to Jesus saying he would never deny Christ, Peter did in fact deny Jesus three times to a maid who insisted that Peter was one of Jesus's disciples. Peter knew he may be killed if the people found out he was one of Christ's disciples and out of fear he did deny knowing Christ three times. This event was recorded in all four of the gospels, Matthew, Mark, Luke, and John. In Matthew:
Matthew 26:69 Now Peter sat without in the palace: and a damsel came unto him, saying, Thou also wast with Jesus of Galilee.
Matthew 26:70 But he denied before them all, saying, I know not what thou sayest.
Matthew 26:71 And when he was gone out into the porch, another maid saw him, and said unto them that were there, This fellow was also with Jesus of Nazareth.
Matthew 26:72 And again he denied with an oath, I do not know the man.
Matthew 26:73 And after a while came unto him they that stood by, and said to Peter, Surely thou also art one of them; for thy speech betrayeth thee.
Matthew 26:74 Then began he to curse and to swear, saying, I know not the man. And immediately the cock crew.
Matthew 26:75 And Peter remembered the word of Jesus, which said unto him, Before the cock crow, thou shalt deny me thrice. And he went out, and wept bitterly.
Account of Peter's betrayal in the Book of Mark:
Mark 14:66 And as Peter was beneath in the palace, there cometh one of the maids of the high priest:
Mark 14:67 And when she saw Peter warming himself, she looked upon him, and said, And thou also wast with Jesus of Nazareth.
Mark 14:68 But he denied, saying, I know not, neither understand I what thou sayest. And he went out into the porch; and the cock crew.
Mark 14:69 And a maid saw him again, and began to say to them that stood by, This is one of them.
Mark 14:70 And he denied it again. And a little after, they that stood by said again to Peter, Surely thou art one of them: for thou art a Galilaean, and thy speech agreeth thereto.
Mark 14:71 But he began to curse and to swear, saying, I know not this man of whom ye speak.
Mark 14:72 And the second time the cock crew. And Peter called to mind the word that Jesus said unto him, Before the cock crow twice, thou shalt deny me thrice. And when he thought thereon, he wept.
Peter's denial of Christ as recorded in the Book of Luke:
Luke 22:54 Then took they him, and led him, and brought him into the high priest's house. And Peter followed afar off.
Luke 22:55 And when they had kindled a fire in the midst of the hall, and were set down together, Peter sat down among them.
Luke 22:56 But a certain maid beheld him as he sat by the fire, and earnestly looked upon him, and said, This man was also with him.
Luke 22:57 And he denied him, saying, Woman, I know him not.
Luke 22:58 And after a little while another saw him, and said, Thou art also of them. And Peter said, Man, I am not.
Luke 22:59 And about the space of one hour after another confidently affirmed, saying, Of a truth this fellow also was with him: for he is a Galilaean.
Luke 22:60 And Peter said, Man, I know not what thou sayest. And immediately, while he yet spake, the cock crew.
Luke 22:61 And the Lord turned, and looked upon Peter. And Peter remembered the word of the Lord, how he had said unto him, Before the cock crow, thou shalt deny me thrice.
Luke 22:62 And Peter went out, and wept bitterly.
Peter's denial of Christ in the Book of St. John: John 18:12 Then the band and the captain and officers of the Jews took Jesus, and bound him, John 18:13 And led him away to Annas first; for he was father in law to Caiaphas, which was the high priest that same year. John 18:14 Now Caiaphas was he, which gave counsel to the Jews, that it was expedient that one man should die for the people. John 18:15 And Simon Peter followed Jesus, and so did another disciple: that disciple was known unto the high priest, and went in with Jesus into the palace of the high priest. John 18:16 But Peter stood at the door without. Then went out that other disciple, which was known unto the high priest, and spake unto her that kept the door, and brought in Peter. John 18:17 Then saith the damsel that kept the door unto Peter, Art not thou also one of this man's disciples? He saith, I am not. John 18:18 And the servants and officers stood there, who had made a fire of coals; for it was cold: and they warmed themselves: and Peter stood with them, and warmed himself. John 18:19 The high priest then asked Jesus of his disciples, and of his doctrine. John 18:20 Jesus answered him, I spake openly to the world; I ever taught in the synagogue, and in the temple, whither the Jews always resort; and in secret have I said nothing. John 18:21 Why askest thou me? ask them which heard me, what I have said unto them: behold, they know what I said. John 18:22 And when he had thus spoken, one of the officers which stood by struck Jesus with the palm of his hand, saying, Answerest thou the high priest so? John 18:23 Jesus answered him, If I have spoken evil, bear witness of the evil: but if well, why smitest thou me? John 18:24 Now Annas had sent him bound unto Caiaphas the high priest. John 18:25 And Simon Peter stood and warmed himself. They said therefore unto him, Art not thou also one of his disciples? He denied it, and said, I am not. John 18:26 One of the servants of the high priest, being his kinsman whose ear Peter cut off, saith, Did not I see thee in the garden with him? John 18:27 Peter then denied again: and immediately the cock crew.