The Director of Corrections and the legislative body of any county or city may enter into agreements for mutual police aid. Pursuant to such agreements the director may authorize employees of state prisons and institutions to cooperate, anywhere within the State, with county and city peace officers in connection with any existing emergency. While so employed the employees shall have all the benefits of workmen's compensation laws, retirement laws, and all other similar laws and for such purposes shall be deemed to be performing services in the course of their regular official duties.
Ca. Pen. Code § 5004