Zakariyya was a prophet of the Children of Israel, named in the Quran among the righteous (6:85). The Prophet ﷺ said that Zakariyya was a carpenter (Sahih Muslim) — a prophet who earned his living by the work of his own hands. He served in the house of worship, which the commentators explain was in Jerusalem (Bayt al-Maqdis).
The wife of ʿImran vowed the child in her womb to the service of Allah. When she gave birth to a girl, Maryam, Allah accepted her with a goodly acceptance and placed her in the care of Zakariyya (3:35–37). The men of the house of worship had competed for the honour of looking after her, casting their pens to decide (3:44). In the authentic hadith of the Night Journey, the Prophet ﷺ described Yahya and ʿIsa as cousins through their mothers (Sahih al-Bukhari; Sahih Muslim), so Zakariyya's family and Maryam were close relatives.
Whenever Zakariyya entered upon her in the prayer chamber (mihrab), he found provision with her. He asked, "O Maryam, where does this come from?" She said, "It is from Allah. Allah provides for whom He wills without measure" (3:37). There and then, Zakariyya called upon his Lord (3:38).
He called on Him quietly: "My Lord, my bones have weakened and my head is aflame with grey hair, and I have never been disappointed in calling upon You, my Lord" (19:3–4). He feared for what his relatives would do after him, and his wife was barren, so he asked for an heir who would inherit from him and from the family of Yaʿqub (19:5–6). The commentators explain that he meant inheriting prophethood and knowledge, not wealth. He also prayed, "My Lord, do not leave me alone, and You are the best of inheritors" (21:89).
While he stood praying in the mihrab, the angels called out to him: Allah gives you glad tidings of Yahya, who will confirm a word from Allah, a leader, chaste, and a prophet from among the righteous (3:39). No one had been given that name before (19:7). Amazed, Zakariyya asked how he could have a son when he was so old and his wife barren. He was told, "Thus Allah does what He wills" (3:40), and "It is easy for Me; I created you before, when you were nothing" (19:9).
He asked for a sign. His sign was that he would not speak to people for three days and nights, though he was not ill, except by gestures (3:41; 19:10). He was told to remember his Lord much and to glorify Him evening and morning. He came out to his people from the mihrab and signalled to them to glorify Allah morning and evening (19:11).
Allah answered him, gave him Yahya and made his wife able to bear a child. He praised the whole family: "They used to hasten to good deeds and call upon Us in hope and fear, and they were humble before Us" (21:90). The Quran and the authentic hadith do not tell us how Zakariyya died; the stories about his death come from unconfirmed reports and are not presented here as fact.