The Rigveda contains verses in which Agni is identified as Apām Napāt, the son of waters, who is conceived in the womb of the water laden clouds as lightning. Here’s an excerpt from the 35th hymn in the 2nd Mandala of the Rigveda (Ralph T.H. Griffith’s translation):
“The Waters' Son hath risen, and clothed in lightning ascended up unto the curled cloud's bosom; And bearing with them his supremest glory the Youthful Ones, gold-colored, move around him.” “Golden in form is he, like gold to look on, his color is like gold, the Son of Waters. When he is seated fresh from golden birthplace those who present their gold give food to feed him.”
In the above verse, Agni (Apām Napāt) is being depicted as a divine entity that emerges from the waters in the form of golden lightning.
Writing more than 2500 years after the Rigveda was composed, Sayana (also known as Sāyaṇācārya), the fourteenth century Vedic philosopher, has remarked that the name Apām Napāt designates Agni as the grandson and not the son of the waters—this is because the herbs and trees are born of the waters and Agni is born from the herbs and trees.