Police officers in Maine watched in horror as their worst fears played out on the streets of Dallas, streamed to the world in real time: A gunman, bent on killing police, took shot after shot as officers and civilians scrambled for cover.

No matter the distance, violence against police is a jarring reminder to the law enforcement community in Maine and across the nation of the dangers officers face each day, Maine State Police Lt. Erik Baker said Friday.

“Watching things unfold last night, you ask yourself, ‘Why do you want to be a police officer, why would you still want to be a police officer?'” Baker said. “But as I got up this morning, I was more proud to keep my head high.”

Many departments, including Portland and the state police, expressed support for Dallas police through public statements, social media posts, and ceremonies of remembrance for the deadliest day for police since Sept. 11.

The outpouring comes after four Dallas police officers and one Dallas Area Rapid Transit officer were gunned down by a former Army reservist and veteran of Afghanistan, identified Friday as Micah Xavier Johnson, 25. Johnson wounded seven other officers and two civilians when he opened fire with a rifle on officers who were watching over a protest led by Black Lives Matter activists.

Locally, police interviewed said that any loss, let alone the slaying of sworn officers, ripples throughout the national police community.

“It’s heart-breaking for officers to see that,” Westbrook police Capt. Steve Goldberg said. “It’s a family in law enforcement. We consider ourselves to be brothers and sisters. It’s hard knowing the families down there lost a loved one. But it’s part of our job. Every time we put on that uniform we know something bad could happen, but it’s an oath we’ve taken. So we still put on that uniform every shift.”

Someone with a keen eye on the shootings in Dallas is Michael Bussiere. He served his last day Friday as chief of police in Lewiston after 26 years with the department, and is joining the police department in Richardson, Texas, a city of 104,000 that adjoins Dallas.

While he is confident in his future department’s ability to deal with the lingering effects of the killings, he acknowledged a broader, troubling paradigm in which police are expected to solve more problems, be they racial divisions, illegal drug epidemics or mental health crises.

“We in police work wear so many hats,” Bussiere said. “I think society is expecting more and more quick fixes with police.”

He said solutions to such widespread and deeply rooted problems come only when everyone in a community is invested in the outcome.

Portland Police Chief Michael Sauschuck said Friday night that his department isn’t changing any procedures in response to the shootings in Dallas.

He said that his officers get daily reminders to be safe and that didn’t change Friday, although it may have had some more resonance following the previous night’s events.

“It’s just being aware of where you are and your personal safety,” Sauschuck said as he oversaw security for a protest march in downtown Portland Friday night. “I would expect every one of them are performing at that high level on a day-to-day basis.”

The event Friday night, which was loosely organized online before the Portland branch of the NAACP stepped in to help file permits with the city, attracted about 500 people who marched from Monument Square to City Hall and then the Portland Police headquarters on Middle Street before returning to Monument Square.

The shootings and the responses by law enforcement also illustrate the expanding role that social media has played in how the public learns about police shootings and how departments react to them.

In both instances where police officers in Baton Rouge, Louisiana, and in Falcon Heights, Minnesota, fatally shot black men, video of the encounters quickly made their way onto social platforms and spread rapidly – including the harrowing, graphic live video from the girlfriend of one of the men, Philando Castille, showing him lying bloodied and motionless in the driver’s seat, with an officer’s weapon still trained on him through the open car window.

In the case of the ambush in Dallas, images, video and live streams from the ground showed the moment when protesters, who had been peacefully marching, reacted to the gunfire and scattered through the streets for cover.

With the use of live video and recorded video of police encounters expanding, Bussiere cautioned the public not to jump to conclusions before all the facts are gathered.

“When an incident occurs, with the scrutiny it gets, especially if it’s been filmed, (members of the public) want to make judgments,” he said. “Sometimes you’ve got to wait.”

Staff Writer Edward D. Murphy contribute to this report.