Attorney General Loretta Lynch on Friday called for calm and urged Americans to “reject the easy impulses of bitterness and rancor” following the murder in Dallas of five police officers -- and, before that, the police shootings of black men in Louisiana and Minnesota. 

Lynch, describing a week of “profound heartbreak and loss,” said the answer to violence must be “calm, peaceful, collaborative and determined” action. 

President Obama also has ordered the flags at half-staff at the White House and other federal buildings and military posts "as a mark of respect for the victims of the attack on police officers." U.S. Capitol flags also are being lowered.  

Five Dallas police officers were killed and seven others wounded Thursday by a sniper who claimed he “wanted to kill white people” during an anti-police brutality protest in Texas.

The protest was one of several held around the country prompted by recent police shootings of black men.

“After the events of this week, Americans across the country are feeling a sense of helplessness, of uncertainty and of fear,” Lynch said. “These feelings are understandable and they are justified. But the answer must not be violence. The answer is never violence.”

Just a few hours earlier, House Speaker Paul Ryan and House Minority Leader Nancy Pelosi both called for peace.

Ryan, in a brief but emotional speech from the House floor, said anger and frustration over the tragedy in Dallas must not be allowed to harden the nation’s divisions but instead unify the country.

“There’s going to be a temptation to let our anger send us further into our corners. Let’s not let that happen,” Ryan said.

He added, “Let’s not lose sight of the values that unite us, our common humanity.”

Ryan said it had been “a long month for America” and that the country had seen “terrible, terrible senseless things.”

“A few perpetrators of evil do not represent us, they do not control us,” Ryan said. “Justice will be done.”

Pelosi, who took the floor after Ryan, echoed the sentiment.

“Justice will be done,” she said. “Justice must be done.”

Former President George W. Bush released a written statement Friday morning praising the work and dedication of police officers.

“Laura and I are heartbroken by the heinous acts of violence in our city last night,” he said. “Murdering the innocent is always evil, never more so than when the lives taken belong to those who protect our families and communities.”