II Chronicles - Chapter 23
Coup #2 – Atalyahu’s Out
In the seventh year of Atalyahu's illegal reign, Yehoyada gathered a faction dedicated to placing the rightful king on the throne. He planned the coup for a Shabbos because that was the day on which the kohanim and Leviim changed their weekly duty rotation. This meant that there would be twice as many on hand to serve as troops: the incoming shift and the outgoing shift. Yehoyada armed his men and positioned them around the boy king. They crowned Yoash and presented him publicly, shouting out "Long live the king!"
Atalyahu heard the commotion and went to see what was going on. When she saw the crowd rejoicing and heard the cheers, she knew it was a coup. Yehoyada had her captured and brought out for execution. After that, Yehoyada led the people in an assault on the temple of the idol, Baal. He then placed control of the Temple of G-d in the hands of the priests and the Levites, as David had intended. The king was placed on his throne and everything was peaceful now that Atalyahu was out of the picture.