Romans 10:9-13
9 That if thou shalt confess with thy mouth the Lord Jesus, and shalt believe in thine heart that God hath raised him from the dead, thou shalt be saved.
10 For with the heart man believeth unto righteousness; and with the mouth confession is made unto salvation.
11 For the scripture saith, Whosoever believeth on him shall not be ashamed.
12 For there is no difference between the Jew and the Greek: for the same Lord over all is rich unto all that call upon him.
13 For whosoever shall call upon the name of the Lord shall be saved.
This passage is the most common prooftext for the doctrine that a believer must either pray to ask for Salvation, or publicly confess Christ in order to be saved from Hell.
This compels many pastors, even those who otherwise preach crystal-clear sermons on Eternal Security and Salvation by faith alone, to puzzlingly add a "sinner's prayer" to their Gospel presentation. Therefore, this passage desperately needs clarification.
Romans chapter 10 begins with the Apostle Paul speaking about wanting the Jews to accept Jesus Christ as their Messiah:
Romans 10:1-4
1 Brethren, my heart's desire and prayer to God for Israel is, that they might be saved.
2 For I bear them record that they have a zeal of God, but not according to knowledge.
3 For they being ignorant of God's righteousness, and going about to establish their own righteousness, have not submitted themselves unto the righteousness of God.
4 For Christ is the end of the law for righteousness to every one that believeth.
Notice above that the method given to obtain "the righteousness of God" is by faith, and not confession.
Then, we arrive at our passage in question, which is partially a quotation from Joel chapter 2 (also quoted in Acts 2:18-21), which has the context of deliverance from physical peril, specifically during the wrath of God on mankind following the Great Tribulation:
Joel 2:30-32
30 And I will shew wonders in the heavens and in the earth, blood, and fire, and pillars of smoke.
31 The sun shall be turned into darkness, and the moon into blood, before the great and terrible day of the Lord come.
32 And it shall come to pass, that whosoever shall call on the name of the Lord shall be delivered: for in mount Zion and in Jerusalem shall be deliverance, as the Lord hath said, and in the remnant whom the Lord shall call.
Above, we see the "sun being turned into darkness" before the "day of the Lord", which is an event mentioned in Matthew 24:29 and Revelation 6:12-17. It occurs after the Great Tribulation, in time with the beginning of God's Wrath:
Matthew 24:29
29 Immediately after the tribulation of those days shall the sun be darkened, and the moon shall not give her light, and the stars shall fall from heaven, and the powers of the heavens shall be shaken:
Revelation 6:12, 16-17
12 And I beheld when he had opened the sixth seal, and, lo, there was a great earthquake; and the sun became black as sackcloth of hair, and the moon became as blood;
16 And said to the mountains and rocks, Fall on us, and hide us from the face of him that sitteth on the throne, and from the wrath of the Lamb:
17 For the great day of his wrath is come; and who shall be able to stand?
This event, then, is a physical judgment on physical people.
In Romans 10, salvation from this physical judgment for rejecting the Messiah is predicated on already believing:
Romans 10:9-14
9 That if thou shalt confess with thy mouth the Lord Jesus, and shalt believe in thine heart that God hath raised him from the dead, thou shalt be saved.
10 For with the heart man believeth unto righteousness; and with the mouth confession is made unto salvation.
11 For the scripture saith, Whosoever believeth on him shall not be ashamed.
12 For there is no difference between the Jew and the Greek: for the same Lord over all is rich unto all that call upon him.
13 For whosoever shall call upon the name of the Lord shall be saved.
14 How then shall they call on him in whom they have not believed? and how shall they believe in him of whom they have not heard? and how shall they hear without a preacher?
Notice that no one can call upon Christ if they "have not believed" (Romans 10:14) - past tense. And, since we know from scores of other Scriptures that Salvation is by faith - "with the heart man believeth unto righteousness" (Romans 10:10) - this means that in order to confess Christ and call upon Him for salvation from temporal judgement, you must already have Salvation from Hell.
This principle of "calling upon the Lord" for salvation from temporal peril or judgment is manifest elsewhere in Scripture:
Psalm 18:3 (2 Samuel 22:4)
3 I will call upon the Lord, who is worthy to be praised: so shall I be saved from mine enemies.
Psalm 50:15
15 And call upon me in the day of trouble: I will deliver thee, and thou shalt glorify me.
Psalm 55:16
16 As for me, I will call upon God; and the Lord shall save me.
Also see Psalm 86:5, 86:7, 88:9, 105:1, 116:2-4, 118:5. These are instances of believers calling upon the Lord for temporal salvation. Turning this "calling upon the name of the Lord" into a sinner's prayer to ask for Salvation from Hell requires mishandling of these texts, and ignorance as to how the phrase is used elsewhere in Scripture.
Therefore, our passage in question from Romans 10 bears witness to the fact that the words "saved" and "salvation" in Scripture do not always refer to eternal Salvation from Hell, but instead often refer to this temporal salvation from peril or judgment (Matthew 14:30, Romans 13:11, Philippians 1:19: 1 Timothy 2:15, 4:16: 2 Corinthians 1:6, Acts 27:31, etc.).
It also bears witness to the fact that, even after Salvation, confession is our recourse to temporal forgiveness and restoration of our earthly fellowship with God (1 John 1:9).
Finally, in Scripture we are given an explicit example of believers who were too afraid to confess Christ, due to the persecution that they would receive:
John 12:42
42 Nevertheless among the chief rulers also many believed on him; but because of the Pharisees they did not confess him, lest they should be put out of the synagogue:
Would the men above be saved from Hell? Of course, they were believers - and "with the heart man believeth unto righteousness" (Romans 10:10). Have they done what was required to be "saved" from the temporal judgment of God on the Jews as a whole for not publicly confessing Christ as their own Messiah? No, they wouldn't be saved from that.
And, note why they didn't confess - they were afraid. Why would they be afraid? Because public confession can lead to intense persecution. This is true in many parts of the world, even unto today, such as the Muslim world, as Islam teaches the death penalty for apostasy. Public confession is not automatic, and takes bravery, meaning if only those who did the work of confessing were saved, then Salvation is of works, in violation of Scripture (Ephesians 2:8-9).
In conclusion, God did not wait until Romans chapter 10 to add a caveat to the simple message of John 6:47, all the while puzzlingly telling us dozens of times elsewhere that Salvation is by faith.
Instead, this verse speaks to salvation from temporal wrath, in reference to a prophecy dealing with the end times, which saw a shadow fulfillment in the destruction of the Jewish nation at the hands of the Romans circa 70 AD, and sees in individual fulfillment in the life of every believer until they confess Christ.