2 Kings 11:2
But Jehosheba, the daughter of king Joram, sister of Ahaziah, took Joash the son of Ahaziah, and stole him from among the king’s sons which were slain; and they hid him, even him and his nurse, in the bedchamber from Athaliah, so that he was not slain.
Joash was the infant son of Ahaziah, the grandson of Jehoram and Athaliah, and Judah's rightful king. Jehosheba was Ahaziah's sister and Joash's aunt, the wife of Jehoiada the high priest, living in the temple apartments. She was loyal to Israel's God, opposed Athaliah's course, and rejected the wicked course of her mother's family.
After Ahaziah died, Athaliah seized the kingdom and usurped the throne in her wicked and corrupt rule. To clear her way she tried to kill the royal heirs, the king's sons and her son's children, and she supposed she had succeeded. Jehosheba stole and rescued the young Joash from among those being slain, and hid him and his nurse in the bedchamber, in the temple, so that he was not slain but survived.
He was kept hidden in the temple under the care of Jehoiada the priest for six years, preserving him while Athaliah held the kingdom. He stayed hidden until he was seven years old and old enough to be brought out and proclaimed king. This begins the account of Joash's reign in Judah under the good priest Jehoiada. When Athaliah's corrupt reign caused the people to revolt in an uprising, Joash was brought out and placed on the throne and proclaimed king, and Athaliah was slain. While Jehoiada lived Joash stayed under his influence, the house of the Lord was repaired, and the worship of the true God was established again.