2 Kings 11:8

And ye shall compass the king round about, every man with his weapons in his hand: and he that cometh within the ranges, let him be slain: and be ye with the king as he goeth out and as he cometh in.

2 Kings 11:8 belongs to the account of Athaliah's rule and usurpation of Judah's throne and the protection, installation and beginning of the reign of Joash under the good priest Jehoiada. In the broader history it falls within a period of nearly 300 years covering the kings of Israel from Joram to Hoshea and the kings of Judah from Ahaziah to Jehoahaz, in the time of the wicked Athaliah and Joash. Joash was the grandson of Jehoram and Athaliah and the son of Ahaziah.

When Ahaziah died, Athaliah seized the throne and tried to kill all her son's children to remove them from her way, but the infant Joash and his nurse were hidden in the temple by his aunt, the wife of Jehoiada the high priest. The verse records Jehoiada's orders for the armed guard to compass the young king Joash round about with weapons in hand, to slay anyone who came within the ranges or breached the ranks, and to stay with the king as he went out and as he came in, protecting him during his public proclamation and enthronement. It directs armed guards to surround the king, keep their weapons ready, kill anyone who enters the guarded area, and accompany him whenever he moves in and out.

The orders protected the seven-year-old Joash when he was brought out from hiding to be proclaimed king in place of Athaliah, with armed men surrounding him as he went out and came in, and anyone who entered the guarded area to support Athaliah was to be killed. Officials guarded him during the uprising that ended Athaliah's corrupt rule, and she was slain before Joash was placed on the throne. By the time Joash was seven, Athaliah's rule had become so corrupt that the people revolted, Joash was then brought out from his hiding place with armed men surrounding him, proclaimed king, and Athaliah was slain. While Jehoiada lived the young king stayed under his influence, the house of the Lord was repaired, and the worship of the true God was established again.

The account is an incidental reference to the Sabbath, showing that the temple guards were changed on the Sabbath and providing evidence that Sabbath observance was recognized in Israel.