2 Chronicles 23:7

And the Levites shall compass the king round about, every man with his weapons in his hand; and whosoever else cometh into the house, he shall be put to death: but be ye with the king when he cometh in, and when he goeth out.

The verse belongs to the account of Athaliah's seven-year reign ending with Joash, also called Jehoash, rising and acceding to Judah's throne. The accession of Jehoash is dated around 778 B.C. The surrounding verses make an incidental reference to the Sabbath in connection with that event.

At the king's coronation the Levites, every man with weapons in hand, were stationed round about the king to guard him and the sanctuary or temple. They were responsible for the safety of the sanctuary as well as for its service. They were to be with the king when he came in and when he went out, escorting Joash into and out of the temple. Whoever else came into the house or temple was to be put to death. Their armed protection secured Joash's public proclamation as king after Athaliah's corrupt rule. This protection formed part of the plan to bring the hidden child to the throne while Athaliah was overthrown.