Athaliah was Ahaziah's mother. She saw that her son was dead. So she began to wipe out the whole royal house of Judah.
But Jehosheba went and got Joash, the son of Ahaziah. She was the daughter of King Jehoram and the sister of Ahaziah. She stole Joash away from among the royal princes. All of them were about to be murdered. She put Joash and his nurse in a bedroom. That's how she hid him from Athaliah. And that's why Athaliah didn't kill him.
The child remained hidden with his nurse at the LORD's temple for six years. Athaliah ruled over the land during that time.
In the seventh year the priest Jehoiada sent for the commanders of companies of 100 men. They were the commanders over the Carites and guards. He had them brought to him at the temple of the Lord. He made a covenant with them. He made them take an oath at the temple. Then he showed them the king's son.
He gave them a command. He said, "Here's what you must do. There are five companies of you. Some of you are in the three companies that are going on duty on the Sabbath day. A third of you must guard the royal palace.
A third of you must guard the Sur Gate. And a third of you must guard the gate that is behind the guard. All of you must take turns guarding the temple.
"The rest of you are in the other two companies. Normally you are not on duty on the Sabbath. But you also must guard the temple for the king.
Station yourselves around the king. Each man must have his weapon in his hand. Anyone else who approaches your companies must be put to death. Stay close to the king no matter where he goes."
The commanders of the companies did just as the priest Jehoiada ordered. Each commander got his men and came to Jehoiada. Some of the men were going on duty on the Sabbath day. Others were going off duty.
Then Jehoiada gave weapons to the commanders. He gave them spears and shields. The weapons had belonged to King David. They had been in the LORD's temple.
The guards stationed themselves around the new king. Each man had his weapon in his hand. They were near the altar and the temple. They stood from the south side of the temple to its north side. Their line formed half of a circle.
Jehoiada brought Ahaziah's son out. He put the crown on him. He gave him a copy of the covenant. And he announced that Joash was king. Jehoiada and his sons anointed him. The people clapped their hands. Then they shouted, "May the king live a long time!"
Athaliah heard the noise the guards and the people were making. So she went to the people at the LORD's temple.
She looked. And there was the king! He was standing next to the pillar. That was the usual practice. The officers and trumpet players were standing beside the king. All of the people of the land were filled with joy. They were blowing trumpets. Then Athaliah tore her royal robes. She called out, "Treason! It's treason!"
The priest Jehoiada gave an order to the commanders of the companies. They were in charge of the troops. He said to them, "Bring her away from the temple between the line of guards. Use your swords to kill anyone who follows her." The priest had said, "She must not be put to death at the LORD's temple."
So they grabbed hold of her as she reached the place where the horses enter the palace grounds. There she was put to death.
Then Jehoiada made a covenant between the LORD and the king and people. He had the king and people promise that they would be the LORD's people. Jehoiada also made a covenant between the king and the people.
All of the people of the land went to Baal's temple. They tore it down. They smashed to pieces the altars and the statues of gods. They killed Mattan in front of the altars. He was the priest of Baal. Then the priest Jehoiada stationed guards at the temple of the Lord.
He took with him the commanders of companies of 100 men. They were the commanders over the Carites and guards. He also took with him all of the people of the land. All of them brought the new king down from the LORD's temple. They went into the palace. They entered it by going through the gate of the guards. Then the king sat down on the royal throne.
All of the people of the land were filled with joy. And the city was quiet. That's because Athaliah had been killed with a sword at the palace.
Joash was seven years old when he became king.