Nehemiah 13:19
And it came to pass, that when the gates of Jerusalem began to be dark before the sabbath, I commanded that the gates should be shut, and charged that they should not be opened till after the sabbath: and some of my servants set I at the gates, that there should no burden be brought in on the sabbath day.
This action belongs to the reform after the return from Persia to Jerusalem, when Judah had departed from the Lord after solemnly pledging to obey God's law, and evils threatening to pervert the nation had crept in during the absence when the influence of Ezra and Nehemiah was withdrawn. The shutting of the gates was a later measure, for earlier the effort to stop Sabbath trading had been to bind the people in a covenant not to buy from the traders, in the hope that this would discourage the traders from coming and so end the traffic. When it began to be dark before the Sabbath, the gates of Jerusalem were shut and kept shut until the Sabbath was past, so that no Sabbath traffic could occur and no burdens or trade goods could be brought in.
The Sabbath is the sign distinguishing Israelites from all other nations as worshipers of the true God, and disregard for it had come through intercourse with idolaters, as heathen merchants and traders induced Israelites to buy and sell on the Sabbath. The rulers had failed to prevent this Sabbath breaking because desire for their own interests led them to favor the ungodly, and they were therefore rebuked for profaning the Sabbath and bringing more wrath upon Israel, just as their fathers had brought evil upon the city. Having more confidence in his own servants than in men whom the magistrates of Jerusalem would appoint, Nehemiah stationed his servants at the gates to enforce his orders that no burden be brought in on the Sabbath day.
The Levites were also directed to guard the gates of Jerusalem to keep the Sabbath from being broken by burdens brought in. They stood together at a large arched stone gateway guarding the entrance to the temple courtyard while men approaching with sacks were stopped, and traders with burdened donkeys, bundles, containers and vessels were kept outside.