23:1 But in the seventh year Jehoiada took courage and entered into a covenant with the commanders of hundreds, Azariah the son of Jeroham, Ishmael the son of Jehohanan, Azariah the son of Obed, Maaseiah the son of Adaiah, and Elishaphat the son of Zichri. 2 And they went about through Judah and gathered the Levites from all the cities of Judah, and the heads of fathers' houses of Israel, and they came to Jerusalem. 3 And all the assembly made a covenant with the king in the house of God. And Jehoiada  said to them, “Behold, the king's son! Let him reign, as the Lord spoke concerning the sons of David. 4 This is the thing that you shall do: of you priests and Levites who come off duty on the Sabbath, one third shall be gatekeepers, 5 and one third shall be at the king's house and one third at the Gate of the Foundation. And all the people shall be in the courts of the house of the Lord. 6 Let no one enter the house of the Lord except the priests and ministering Levites. They may enter, for they are holy, but all the people shall keep the charge of the Lord. 7 The Levites shall surround the king, each with his weapons in his hand. And whoever enters the house shall be put to death. Be with the king when he comes in and when he goes out.”
8 The Levites and all Judah did according to all that Jehoiada the priest commanded, and they each brought his men, who were to go off duty on the Sabbath, with those who were to come on duty on the Sabbath, for Jehoiada the priest did not dismiss the divisions. 9 And Jehoiada the priest gave to the captains the spears and the large and small shields that had been King David's, which were in the house of God. 10 And he set all the people as a guard for the king, every man with his weapon in his hand, from the south side of the house to the north side of the house, around the altar and the house. 11 Then they brought out the king's son and put the crown on him and gave him the testimony. And they proclaimed him king, and Jehoiada and his sons anointed him, and they said, “Long live the king.”
12 When Athaliah heard the noise of the people running and praising the king, she went into the house of the Lord to the people. 13 And when she looked, there was the king standing by his pillar at the entrance, and the captains and the trumpeters beside the king, and all the people of the land rejoicing and blowing trumpets, and the singers with their musical instruments leading in the celebration. And Athaliah tore her clothes and cried, “Treason! Treason!” 14 Then Jehoiada the priest brought out the captains who were set over the army, saying to them, “Bring her out between the ranks, and anyone who follows her is to be put to death with the sword.” For the priest said, “Do not put her to death in the house of the Lord.” 15 So they laid hands on her,  and she went into the entrance of the horse gate of the king's house, and they put her to death there.
16 And Jehoiada made a covenant between himself and all the people and the king that they should be the Lord's people. 17 Then all the people went to the house of Baal and tore it down; his altars and his images they broke in pieces, and they killed Mattan the priest of Baal before the altars. 18 And Jehoiada posted watchmen for the house of the Lord under the direction of the Levitical priests and the Levites whom David had organized to be in charge of the house of the Lord, to offer burnt offerings to the Lord, as it is written in the Law of Moses, with rejoicing and with singing, according to the order of David. 19 He stationed the gatekeepers at the gates of the house of the Lord so that no one should enter who was in any way unclean. 20 And he took the captains, the nobles, the governors of the people, and all the people of the land, and they brought the king down from the house of the Lord, marching through the upper gate to the king's house. And they set the king on the royal throne. 21 So all the people of the land rejoiced, and the city was quiet after Athaliah had been put to death with the sword. (ESV)