They shall be appointed and qualified in the same manner, and shall have, while on duty, the same powers, as police officers.