Aiming to find compromise with Gov. Charlie Baker over police accountability and oversight, Massachusetts state senators agreed Monday to scale back restrictions they had sought to put on the use of facial recognition software by law enforcement and to limit the influence of a civilian led commission over police training.

The newest version of the police reform legislation emerged in the Senate in the late afternoon Monday and passed. With the House in session Tuesday, a spokeswoman for Baker said the governor would sign this new version if the House goes along with the changes made by the Senate, NBC Boston reports.

The original bill lawmakers sent to Baker banned almost all law enforcement use of facial recognition systems, only allowing police to ask the Registry of Motor Vehicles to perform a search with a warrant or if there is "an emergency involving immediate danger of death or serious physical injury."

Under the changes the Senate approved, police would be able to perform facial recognition searches to assist with criminal cases or to mitigate "substantial risk of harm" after submitting a written request to the RMV, Massachusetts State Police, or the Federal Bureau of Investigation.

The new amendment would also keep in place a municipal police training committee under the administration's Executive Office of Public Safety and Security, rather than transfer its duties to a new majority-civilian POST commission.