The age of Hazrat Zakaria (a.s.) was ninety-nine years and that of his wife eighty nine. Yet, he was hopeful of the Grace of Allah (S.w.T.) and he prayed with sincerity, “He said My Lord! Surely my bones are weakened and my head flares with hoariness, and my Lord! I have never been unsuccessful in my prayer to Thee: And surely I fear my cousins after me, and my wife is barren, therefore grant me from Thyself an heir, who would inherit me and inherit from the children of Yaqub, and make him, my Lord, one in whom Thou art well pleased.”
O Zakaria! Surely We give you good news of a boy whose name shall be Yahya: We have not made before anyone his equal. He said,
“O my Lord! When shall I have a son, and my wife is barren, and I myself have reached the extreme degree of old age? He said: “So shall It be, your Lord says: It is easy to Me, and indeed I created you before, when you were nothing.” (Surah Maryam 19:4-9)
Thus Allah (S.w.T.) accepted the invocation of Hazrat Zakaria (a.s.) and Hazrat Yahya (a.s.) was born to him.