PHOENIX — With just hours left before a midnight deadline, Gov. Doug Ducey of Arizona vetoed legislation on Monday that would have prevented law enforcement agencies from releasing the names of officers involved in serious or fatal shootings for 60 days.

Proponents of the legislation argued that it allowed for a cooling-off period, easing tensions and helping reduce threats to officers. But the bill attracted the scrutiny of civil rights groups, news organizations in Arizona and even the chiefs of police departments in the state, who worried that shielding officers’ names would limit transparency, stoke distrust of law enforcement and limit the discretion of local officials.

And on Monday, the governor said that he shared some of those concerns.

“I know the goal of this legislation is to protect officers and their families, and it’s a goal I share,” Governor Ducey said in a letter explaining the veto. He added, “Unfortunately, I don’t believe this bill in its current form best achieves the objectives we share, and I worry it could result in unforeseen problems.”

Supporters of the bill said they were motivated by shootings here, but the bill also tapped into broader anxieties that followed the events in Ferguson, Mo., where the officer who fatally shot an unarmed teenager fled his home.