1When Athaliah, Ahaziah's mother, saw that her son was dead, she rose up and killed all the royal heirs.
2But Jehosheba, King Joram's daughter and Ahaziah's sister, took Joash, Ahaziah's son. She secretly took him and his nurse from among the king's sons who were being killed, and put them in a bedroom. They hid him from Athaliah so he would not be killed.
3He remained hidden with her in Yahweh's house for six years while Athaliah reigned over the land.
4In the seventh year, Jehoiada sent for and brought the captains of the Carites and the guards to him in Yahweh's house. He made an agreement with them, and in Yahweh's house, he had them make a promise and then showed them the king’s son.
5He commanded them, "This is what you must do: a third of you who come on duty on the Sabbath will guard the king's palace;
6a third of you will be at the Sur Gate; and a third of you will be at the gate behind the royal guard. You are to guard the palace and act as a barrier.
7Your two companies, everyone who goes off duty on the Sabbath, will guard Yahweh’s house around the king.
8You are to surround the king, everyone with his weapons in hand. Anyone who tries to break through your ranks must be killed. Stay with the king as he goes out and comes in."
9The captains of the hundreds did everything that Jehoiada the priest commanded. Each one took his men—those who were coming on duty on the Sabbath and those who were going off duty on the Sabbath—and came to Jehoiada the priest.
10The priest gave the captains of the hundreds the spears and shields that had belonged to King David and were kept in Yahweh's house.
11The guards stood, each with his weapons in hand, from the right side of the temple to the left, by the altar and the temple, all around the king.
12Then he brought out the king's son, put the crown on him, and gave him the covenant. They made him king and anointed him. They clapped their hands and shouted, "Long live the king!"
13When Athaliah heard the noise from the guards and the people, she went to the people in Yahweh's temple.
14She looked and saw the king standing by a pillar, as was the custom, with the captains and trumpeters beside him. All the people of the land were celebrating and blowing trumpets. Then Athaliah tore her clothes and cried, "Treason! Treason!"
15Jehoiada the priest ordered the commanders of the army, "Bring her out between the ranks. Kill anyone who follows her with a sword." The priest had said, "She must not be killed in Yahweh's temple."
16So they made way for her, and she went out through the horses' entrance to the king's palace, and she was killed there.
17Jehoiada made a covenant between Yahweh and the king and the people, so that they would be Yahweh's people. He also made a covenant between the king and the people.
18All the people of the land went to the temple of Baal and tore it down. They completely smashed his altars and idols, and they killed Mattan, the priest of Baal, in front of the altars. The priest then appointed officials to oversee Yahweh's temple.
19He took the commanders of the hundreds, the Carites, the guards, and all the people of the land, and they brought the king down from Yahweh's temple. They went through the gate of the guard to the king's palace, and he sat on the royal throne.
20So all the people of the land rejoiced, and the city was peaceful. Athaliah had been killed with a sword at the king's palace.
21Jehoash was seven years old when he became king.