Acts 2:36-41
36 Therefore let all the house of Israel know assuredly, that God hath made that same Jesus, whom ye have crucified, both Lord and Christ.
37 Now when they heard this, they were pricked in their heart, and said unto Peter and to the rest of the apostles, Men and brethren, what shall we do?
38 Then Peter said unto them, Repent, and be baptized every one of you in the name of Jesus Christ for the remission of sins, and ye shall receive the gift of the Holy Ghost.
39 For the promise is unto you, and to your children, and to all that are afar off, even as many as the LORD our God shall call.
40 And with many other words did he testify and exhort, saying, Save yourselves from this untoward generation.
41 Then they that gladly received his word were baptized: and the same day there were added unto them about three thousand souls.
The Grace New Testament Commentary - Acts 2:37-38
2:37 "Lord and Christ", the last words the audience hears applied to Jesus, finally awaken them to the truth of His identity as the Messiah. Luke records that they were cut to the heart - a reaction that underscores their utmost conviction regarding Jesus as Messiah and their role in His death. Their sensitized conscience (borne from the conviction that they had crucified the Savior) leads to a question that reveals their belief in Jesus. They asked "Men and brethren, what shall we do?" Their question and Peter's answer indicate that they had believed in Jesus.
Peter did not speak to an uninformed multitude. They knew both the Scriptures and the miraculous ministry of Jesus (cf. v 22). The apostle Peter presented a case for Jesus as Messiah from the OT that they could both follow and correlate with contemporary events and past Jewish history. By the time Peter had clarified the truth of Jesus' resurrection and ascension and they had correlated it with the events at Pentecost (cf. vv 29-35), everything fell into place. They unequivocally identified Jesus as the Messiah - and so believed in Him. Now they wanted to know what to do to reestablish fellowship with Him.
2:38 Repentance provided the answer to their dilemma. They needed to reestablish their relationship with the Messiah they had just believed in. Peter does not here require additional conditions for eternal life. Belief in Jesus counts as the singular condition for guaranteed eternal life in both the OT and the NT. Apparently in the case of those who had the privilege of seeing Jesus' earthly ministry (cf. v 22), and yet disbelieved both Him and John (cf. Luke 7:31-35), God required a public identification with Jesus by baptism (and a corresponding rejection of participation in the sin of that generation). Much like the way God requires confession of sins in order for Christians to maintain and enjoy fellowship with Him (1 John 1:9), in these unique cases God required repentance and baptism for the initiation of the Christian life.
The Gentile Cornelius and those in his household who believed received the Holy Spirit before their baptism (Acts 10:43-48; 11:15-18). Palestinian Jews, however, believed in Jesus and received eternal life before receiving the Holy Spirit (Acts 2:37-39). The initial Samaritans who believed - after the crucifixion - also received the Holy Spirit after their baptism as well as the laying on of hands by the apostles Peter and John (cf. Acts 8:14-17). Repentance, although required for fellowship, did not constitute a condition for eternal life, since Peter recommended it to believers in Jesus already. Likewise, receiving the gift of eternal life did not require baptism (cf. John 3:16-18).
Jesus had likened His own baptism to the death He would suffer (cf. Luke 12:50). Furthermore, the Holy Spirit came upon Him at His baptism (cf. Luke 3:21-22). Now those of that generation who condemned Him would publicly associate themselves with Him and receive the Holy Spirit by whom they would join other believers in the Body of Christ. They did not recant their Jewishness, but rather their role in the crucifixion of the Messiah. Furthermore these conditions do not hold today, since no one of that particular generation remains.
Charles Bing - Grace, Salvation, and Discipleship - Repent and be Baptized, Acts 2:37-39
(Salvation) Interpretation: People must turn from sins and be baptized to be saved.
First (Discipleship) Interpretation: People must change their minds about (believe in) Jesus Christ as their Savior and then be baptized to show that they are forgiven their sins.
Second (Discipleship) Interpretation: The Jews who realized they crucified their Messiah have believed in Him and must now repent of that sin to be forgiven for the purpose of fellowship with God, and be baptized to identify with those who are forgiven and saved.
Third (Discipleship) Interpretation: The Jews who realized they crucified their Messiah must now believe in Him as their Savior and declare their faith through baptism to escape judgment on their sinful generation and identify with the new Christian community.
This has been the "go-to" passage for those who argue that baptism is necessary for salvation. But that interpretation meets immediate resistance from those who say baptism is a work that contradicts salvation by grace through faith alone. The latter view is supported by Acts 10:43-44, 15:7-9 where people believed and received the Holy Spirit before they were baptized, and many occasions where people were saved with no mention of baptism as a condition in the narrative or in the preaching of the gospel (Acts 4:4; 13:38-49; 15:1-11; 17:2-4, 10-12; 18:27-28; 20:18-21).
Overall, it is important to view the book of Acts as a transitional book. The gospel message now included the cross and resurrection as well as the promise of the Holy Spirit. Jews who believed in Jesus Christ in the Gospels didn't necessarily know about His work on the cross and His resurrection since those events had not yet happened. In the Gospels, Jesus also promised the giving of the Holy Spirit as something still future. In Acts, the Samaritans (half Jews) and Jews who believed received the Spirit in a subsequent event (Acts 8:14-18; 9:17; 19:5) while Gentiles received the Spirit immediately (Acts 10:44-48).
Though a notoriously difficult passage, there are several interpretations that preserve the gospel of salvation by grace through faith alone. In the first (Discipleship) interpretation, baptism "for the forgiveness of sins" is not seen as a condition for salvation, because "for" (eis) is given the meaning "on the basis of" or "because one has been forgiven." However, the causal use of eis in the New Testament is debatable.
A second (Discipleship) interpretation considers the historical and transitional nature of the narrative. Peter is addressing the Jewish nation that has just crucified the Messiah. When they are convinced of what they had done, they believed in Jesus Christ, indicated by the fact that "they were cut to the heart," and asked what they should do next. Peter's command to repent and be baptized is what they need to do to identify with the new Christian community in order to escape judgment for their terrible sin of crucifying Christ. They would then receive forgiveness for that sin and receive the promised Holy Spirit. Some may think it a stretch to assume "cut to the heart" is the same as believing in Jesus Christ for eternal life because knowing you have sinned is not the same as believing in Christ for forgiveness and eternal life.
The third interpretation that keeps salvation through faith alone also considers the transitional aspect of Peter addressing the Jewish nation. When they are "cut to the heart," the Jews realized their sin of killing the Messiah, but had not yet embraced His promise of eternal life. Peter says they still need to repent or change their minds about (which is essentially saying "believe in") Jesus Christ as their Savior who will forgive all their sins and give them the Holy Spirit. Baptism is how they show both their repentance that separates them from the sinful nation and their faith that identifies them with the new community of believers. Baptism is a visible display of their faith, not a condition for salvation. In support, it is noted that the command to "repent" is in the plural, which corresponds to the plural in "you shall receive the gift of the Holy Spirit," but the command to be baptized is singular and thus parenthetical.
Each of these (Discipleship) interpretations has their strengths and weaknesses. However, in light of clear biblical teaching, any one of them is stronger than the interpretation that makes baptism a condition for eternal life.
As Acts shows later, Gentiles who believed received the Holy Spirit immediately apart from baptism (Acts 10:40-44). That is the way God works today. Anyone who believes in Jesus Christ is saved immediately (Salvation), but should be baptized as soon as possible to declare that faith and to publicly identify with the Christian community (Discipleship). Though baptism is not a condition for salvation, we should not minimize its importance; it is the first step of obedience in following Jesus Christ.