Whenever any peace officer of a city, county, or city and county of this state is injured, dies, or is disabled from performing his or her duties as a peace officer by reason of engaging in the apprehension or attempted apprehension of law violators or suspected law violators or protection or preservation of life or property, or the preservation of the peace anywhere in this state, including the local jurisdiction in which he or she is employed, but is not at the time acting under the immediate direction of his or her employer, he, she, or his or her dependents, as the case may be, shall be accorded by his or her employer all of the same benefits including the benefits of the Workers’ Compensation Law, which he, she, or they would have received had that peace officer been acting under the immediate direction of his or her employer. Any injury, disability, or death incurred under the circumstances described in this section shall be deemed to have arisen out of and been sustained in the course of employment for purposes of workers’ compensation and all other benefits.