With the death of Ahaziah, Athaliah decided to take the throne herself. Immediately, she murdered her male grandchildren, along with every possible heir to the throne. She made herself queen. However, Jehosheba, Ahaziah's sister, rescued Ahaziah's baby son, Joash, and with the help of her husband, Jehoiada the priest, hid Joash in the temple for six years.
In the seventh year of Athaliah, Jehosheba's husband, Jehoiada, made agreements with certain officers in the army. They went throughout Judah and together, with the Levites and principal elders of Israel, came to Jerusalem and assembled in the temple. Jehoiada then said, “Behold, the king's son shall reign, as the Lord has said of the sons of David.” Then he laid out his plan: on the sabbath, one-third of the priests and the Levites were to keep watch over the doors, one-third were to keep watch at the king's house, and one-third at a specified gate. No one was to come into the temple except the priests and the Levites.
The Levites were instructed to surround the king, every man armed, and anyone who came into the house was to be put to death. All agreed, and when the day came, everyone was in position. Then they brought out Joash, the king's son, put the crown on him and made him king. Then Jehoiada and his sons anointed him, and said, “ Long live the king! ”
When Athaliah heard the noise of people running and praising the king, she came to the temple. When she looked, there was the king with the leaders and numerous singers and musicians all rejoicing. Athaliah tore her clothes and shouted, “Treason! Treason!”
Jehoiada commanded the officers to take her outside of the temple under guard and kill her and her followers. So they seized her and took her outside and killed her. Jehoiada made a covenant with the new king, and all the people, that they should be the Lord's people. Then all the people went to the temple of Baal and tore it down, breaking into pieces the altars and images. They also killed Mattan, the priest of Baal. This being done, everyone enjoyed a great celebration. (2 Kings 11:1-20; 2 Chronicles 22:10-23:1-15)