California Gov. Jerry Brown and the state's top Senate leader have agreed to legislation that would further restrict interactions between state and local law enforcement officers and federal immigration agents.

Senate President Pro Tem Kevin de Leon on Monday agreed to changes demanded by Brown following fierce opposition from sheriffs and other law-enforcement officials.

The legislation will now preserve the ability of law officers to cooperate on federal task forces as long as the task forces do not specifically target immigration enforcement.

Police and jail officials would be able to notify U.S. immigration agents if they detain people with convictions for some 800 crimes on their records.

The Assembly and Senate have until Friday to approve the measure.

U.S. Immigrations and Customs Enforcement had no immediate comment.