The judicial and ministerial officers of justice in the state, and the mayor, aldermen, marshals and police of cities and towns, and the director, commissioner, or similar head of any metropolitan or municipal police department, whether elected or appointed, are also conservators of the peace, and are required to aid in the prevention and suppression of public offenses, and for this purpose may act with all the power of the sheriff.