Section 5. When an armed force, called out under chapter thirty-three to suppress a tumult or riot, or to disperse a body of men acting together by force and with intent to commit a felony, or to offer violence to persons or property, or with intent by force or violence to resist or oppose the execution of the laws of the commonwealth, arrives at the place of such unlawful, riotous or tumultuous assembly, its members shall obey such orders for suppressing the riot or tumult, and for dispersing and arresting all persons who are committing any of said offences, as they have received from the governor, or a judge of a court of record, or the sheriff of the county, and also such orders as they there receive from any two of the magistrates or officers before mentioned.