After the first of two ambush slayings of police officers in Dallas and Baton Rouge, La., Hennepin County Sheriff Rich Stanek gave new marching orders to his deputies: No more solo patrols.

Stanek joining law enforcement agencies across the country who are taking precautions to protect officers — including here in Minnesota.

St. Paul police already have doubled up, and in Minneapolis, police Chief Janeé Harteau gave a similar order mere hours after the most recent attack in Baton Rouge, La., although police union officials said the practice was already generally in force. The moves reflect similar orders relayed across the country to officers in places like Baltimore; Seattle; New Orleans; Fort Worth, Texas, and Portland, Ore. Patrol officers in Milwaukee also were ordered to work in two-person squad teams, after an officer was seriously wounded in a shooting over the weekend.

Law enforcement officials say the moves were in direct response to Sunday's attack, in which three officers investigating a report of an armed man were ambushed and killed in Baton Rouge, and another three were wounded. Authorities have said the suspect harbored anti-police feelings, fueled by the shooting deaths of Alton Sterling, Philando Castile and other black men during encounters by law enforcement officers.

Hennepin County Sheriff's Office spokesman Jon Collins said that for the time being, deputies in the agency's Enforcement Services Division — which responds to 911 calls, deals with civil matters and serves warrants — would start pairing up as a precaution.

While this would mean fewer squad cars patrolling city streets, Collins said, "Officer safety is a top priority, so we feel it was a needed change for now."

In Minneapolis, Harteau wrote in a Sunday Facebook post that ensuring public safety remained her top priority.

"This must include the safety of our officers who risk their own lives each day to keep us all safe," she wrote. "Attacks on law enforcement cannot be tolerated and is an attack on the fabric of our country. Violence is not the solution."

Minneapolis police officials did not respond to a request for comment on Monday.

Lt. Bob Kroll, head of the union that represents the Minneapolis Police Department's 840 sworn officers, called the Baton Rouge attack a "huge wake-up call" for law enforcement officers everywhere, which came at a time when police behavior has been scrutinized as never before.

After the Baton Rouge attack, Harteau circulated an internal memo ordering all officers to work in pairs and be extra vigilant, he said. "You can just do so much more and reach so much faster when you have two people there," Kroll said. "It's just going back to basics."

He said the moves wouldn't necessarily affect staffing levels on any given shift. He added that continued criticism of police has hurt morale among the rank-and-file and made their jobs more difficult.

Observers say the recent police shootings of Sterling in Baton Rouge and Philando Castile in Falcon Heights, both of which were captured on video and streamed countless times online, have led to widespread protests and only inflamed tensions between police and communities of color.

While the number of officers shot and killed in the line of duty has decreased in recent decades, law enforcement officials say that policing still remains inherently dangerous work and that officers were on edge even before the Baton Rouge attack. Police, officials say, regularly receive threats and calls for violence against them on social media and during protests.

Others disagree. Brettina Davis, a Twin Cities community activist and organizer, said the charge that groups like Black Lives Matter have fostered a climate that tolerates attacks on police is unfounded. Protesters have been largely peaceful in most cities and have renounced violent actions as they fight for police reform.

"Nobody should have to be killed. Nobody should have to be murdered in cold blood," Davis said. "All these events are tragic, but people aren't going to stop trying to get equality."

Minneapolis City Council Member Linea Palmisano, who sits on the council's public safety committee, welcomed Harteau's decision. "The police I've spoken with are very, very self-aware," she said. The department has made strides in recent months in dealing "with a lot of deep-seated distrust in police," she added.

At least one recent case highlights the problem.

Last month, Minneapolis officers responding to a domestic call were told by a woman that her ex-husband had made "recent threats" to kill police officers, judges, politicians and teachers. The man, who suffered from "bad hallucinations," had a cache of weapons and body armor that he intended to use against his targets, the woman told police, according to a search warrant application filed in Hennepin County District Court. Police raided the man's apartment, recovering a ballistic vest, .223-caliber magazines and a flashbang grenade, authorities said. The man was arrested and charged with making terroristic threats.

Lisa Clemons, a former Minneapolis cop who now serves part-time on the Police Department's community crisis team, said doubling up patrols is a common tactic by departments during times of acute tensions.

"You should always have two cops riding together, because you never know when things could go bad," said Clemons. She recalled her time on the street in the late 1980s and early '90s, during which officers often feared being lured to a secluded location by a "false 911" call and ambushed. "[Harteau] is doing right; she's protecting her officers, but she's also protecting the city with that action."