22:1 And the inhabitants of Jerusalem made Ahaziah, his youngest son, king in his place, for the band of men that came with the Arabians to the camp had killed all the older sons. So Ahaziah the son of Jehoram king of Judah reigned. 2 Ahaziah was twenty-two years old when he began to reign, and he reigned one year in Jerusalem. His mother's name was Athaliah, the granddaughter of Omri. 3 He also walked in the ways of the house of Ahab, for his mother was his counselor in doing wickedly. 4 He did what was evil in the sight of the Lord, as the house of Ahab had done. For after the death of his father they were his counselors, to his undoing. 5 He even followed their counsel and went with Jehoram the son of Ahab king of Israel to make war against Hazael king of Syria at Ramoth-gilead. And the Syrians wounded Joram, 6 and he returned to be healed in Jezreel of the wounds that he had received at Ramah, when he fought against Hazael king of Syria. And Ahaziah the son of Jehoram king of Judah went down to see Joram the son of Ahab in Jezreel, because he was wounded.
7 But it was ordained by God that the downfall of Ahaziah should come about through his going to visit Joram. For when he came there, he went out with Jehoram to meet Jehu the son of Nimshi, whom the Lord had anointed to destroy the house of Ahab. 8 And when Jehu was executing judgment on the house of Ahab, he met the princes of Judah and the sons of Ahaziah's brothers, who attended Ahaziah, and he killed them. 9 He searched for Ahaziah, and he was captured while hiding in Samaria, and he was brought to Jehu and put to death. They buried him, for they said, “He is the grandson of Jehoshaphat, who sought the Lord with all his heart.” And the house of Ahaziah had no one able to rule the kingdom.
10 Now when Athaliah the mother of Ahaziah saw that her son was dead, she arose and destroyed all the royal family of the house of Judah. 11 But Jehoshabeath,  the daughter of the king, took Joash the son of Ahaziah and stole him away from among the king's sons who were about to be put to death, and she put him and his nurse in a bedroom. Thus Jehoshabeath, the daughter of King Jehoram and wife of Jehoiada the priest, because she was a sister of Ahaziah, hid him  from Athaliah, so that she did not put him to death. 12 And he remained with them six years, hidden in the house of God, while Athaliah reigned over the land. (ESV)