The people of Jerusalem made Jehoram's youngest son Ahaziah king in his place, because the raiders who came to the camp with the Arabs had killed all the older sons. So Jehoram's son Ahaziah became king of Judah.
Ahaziah was 42 years old when he began to rule, and he ruled for one year in Jerusalem. His mother was Athaliah, the granddaughter of Omri.
Ahaziah also followed the ways of Ahab's family, because his mother gave him advice that led him to sin.
He did what the LORD considered evil, as Ahab's family had done. After his father died, they advised him to do what Ahab's family had done. They did this to destroy him.
Ahaziah followed their advice and went with Ahab's son King Joram of Israel to fight against King Hazael of Aram at Ramoth Gilead. There the Arameans wounded Joram.
Joram returned to Jezreel to let his wounds heal. (He had been wounded by the Arameans at Ramah when he fought against King Hazael of Aram.) Then Jehoram's son Ahaziah went to Jezreel to see Ahab's son Joram, who was sick.
God brought about Ahaziah's downfall when he went to Joram. He went with Joram to meet Jehu, grandson of Nimshi. (The LORD had anointed Jehu to destroy Ahab's family.)
When Jehu was executing judgment on Ahab's family, he found Judah's leaders (Ahaziah's nephews) who were serving Ahaziah, and he killed them.
He searched for Ahaziah, and Jehu's men captured him while he was hiding in Samaria. They brought him to Jehu and killed him. Then they buried him. They explained, "Ahaziah is Jehoshaphat's grandson. Jehoshaphat dedicated his life to serving the LORD with all his heart." But no one in Ahaziah's family was able to rule as king.
When Ahaziah's mother, Athaliah, saw that her son was dead, she began to destroy the entire royal family of the house of Judah.
But Jehoshebath, daughter of the king and sister of Ahaziah, took Ahaziah's son Joash. She saved him from being killed with the king's other sons, and she put him and his nurse in a bedroom. Jehoshebath was the daughter of King Jehoram and wife of Jehoiada the priest. Because she was also Ahaziah's sister, she hid Joash from Athaliah. So he wasn't killed.
Joash was with the priests. He was hidden in God's temple for six years while Athaliah ruled the country.