Baptism of fire
An ordeal or martyrdom. More recently, a soldier's first experience of battle.
The term refers back to actual martyrdoms by fire, or to the grace of the Holy Spirit imparted through Christian baptism. The second of these is alluded to in the Bible; for example, this version in the King James Version, Matthew 3:11:
I indeed baptize you with water unto repentance: but he that cometh after me is mightier than I, whose shoes I am not worthy to bear: he shall baptize you with the Holy Ghost, and with fire.
That meaning has largely gone out of use and the meaning most often used now is of a soldier's first experience of battle. 'Baptism' because battle is new to him and 'fire' from the firing of guns, that is, he is 'under fire'. The connection between the earlier religious meaning and the later military meaning isn't clear. It is quite possible that the two are independent of each other.
The military meaning is listed by the Oxford English Dictionary as being first recorded, in French, in O'Meara's Napoleon in Exile, 1822:
"I love a brave soldier who has undergone, le baptéme du fer, whatever nation he may belong to."
Unless that is mis-transcribed from O'Meara's work, it can't be properly called the first citation of 'baptism of fire' as it translates into English as 'baptism of iron', although the meaning, of 'first experience of hostile use of weaponry' is clear. The first printing of the actual phrase as we now use it in English is a little later, in George Lawrence's Guy Livingstone, 1857:
"It's only in their baptism of fire that the young ones shrink and start."