Editor's note: This story was originally published on Wednesday, Nov. 2, 2016.

Shock and heartbreak hung over the Des Moines metro area Wednesday after a lone killer in the dark of night gunned down two local police officers patrolling in their vehicles.

Urbandale Police Officer Justin Martin, 24, and Des Moines Police Sgt. Anthony “Tony” Beminio, 38, were killed in separate barrages of gunfire about 2 miles apart early Wednesday morning.

The man accused of slaying them, Scott Michael Greene, 46, of Urbandale, has had several run-ins with local police and school officials. He was taken into custody less than nine hours after the shooting when he turned himself over to a Department of Natural Resources employee in rural Dallas County.

News accounts of the slayings dominated media coverage across the United States. And it plunged the Des Moines metro once more into mourning — less than eight months after two Des Moines police officers were killed in a fiery crash on Interstate Highway 80 with a drunken driver traveling the wrong way.

On Wednesday, residents once again placed fresh flowers on black-shrouded police vehicles memorializing fallen officers.

"We're a very tight-knit community," said Sgt. Paul Parizek, Des Moines police department spokesman. "Des Moines is not a big city. We all know each other. We're heartbroken."

In Washington, D.C., U.S. Attorney General Loretta Lynch described the attacks as “senseless” and “deliberately directed at those who risk their lives” to safeguard their communities. President Barack Obama, in a statement, expressed his condolences.

Martin was the first Urbandale officer killed in the line of duty. Beminio was the 23rd Des Moines officer killed while on the job.

The two are now among 16 officers who have been killed in ambush attacks in the U.S. this year, according to the National Law Enforcement Officers Memorial Fund.

A spokesman for the organization said ambushes of officers are on the increase in the U.S. Five officers were gunned down in Dallas in July, and 10 days later, three officers were killed in Baton Rouge, La.

“We absolutely did not think it was going to happen here,” Parizek said.

How the shootings unfolded

At 7 p.m. Tuesday, Officer Martin began his 12-hour patrol shift. Six hours later, dispatchers began getting reports of shots fired at 7000 Aurora Ave. in Urbandale.

One caller, an off-duty officer, told dispatchers he had heard 15 to 20 gunshots. Other officers told dispatchers that they too had heard shots.

Urbandale resident Russell Cheatem, 52, also heard gunfire and looked outside the window of his home to see what was happening. He told The Des Moines Register that he saw a man standing next to the driver’s side window of a police vehicle at 70th Street and Aurora Avenue.

He said the man walked back to a nearby truck and drove away. A few minutes later, Cheatem said he noticed the police vehicle was still in the street.

He went out to investigate and found Martin, who had been shot several times. Cheatem said he called 911.

“When I saw the bullet holes, I pulled the door open and realized there was nothing I could do for him,” he said.

A few minutes later, Cheatem said he heard more gunshots.

“It was the exact same, pow-pow-pow-pow-pow — rapid fire,” he said.

'Officer down'

When Sgt. Beminio heard that an officer at been shot in Urbandale, he headed toward the scene, Parizek said.

But at about 1:26 a.m., Beminio was apparently gunned down by the same assailant suspected of killing Martin, Parizek said. Beminio was found dead in his vehicle at Merle Hay Road and Sheridan Avenue, about 2 miles from where Martin was slain.

“All units from WestCom, Des Moines has put out an officer down,” a dispatcher radioed to officers in the western suburbs.

Parizek said that neither officer “had an opportunity to interact with the suspect. It doesn’t look like there was an exchange of conversation. There definitely wasn’t an opportunity for these officers to defend themselves or respond to the attack.

“Both officers were seated in their cars and were shot while they were seated.”

Bob Lipman, 70, who lives near where Beminio was shot, said sometime after 1 a.m. Wednesday he heard something that sounded like "pounding on the house."

He said he looked out the window and saw a police car with its lights on but not moving. He looked out the windows several times, and "each time, it was sitting there," he said.

A few minutes later, about seven or eight police cars were in the intersection, Lipman said, and then he saw an ambulance.

At about 1:45 a.m., two police officers rang his doorbell, Lipman said. They asked if he saw anything, and he told them about the "pounding" that he heard, which might have been gunshots.

Finney: The loss of 2 more cops just hurts too damn much

While one of the officers talked to Lipman, the other had his gun drawn, pointed outward, away from the house, Lipman said. After the officers finished asking their questions, they told Lipman to lock his doors and stay in the house, he said.

"This doesn't happen in Des Moines, Iowa," said Lipman, who is originally from New York. "Unfortunately we're hearing about these episodes all across the country. I get very upset when I hear any negative publicity about officers. They do a job that I would not do."

Shortly before 6 a.m., law officers identified Greene as a suspect in the shootings. At about 9:30 a.m., Greene flagged down a DNR employee in rural Dallas County, showed him his driver’s license, and asked the employee to call 911.

Greene was taken into custody, without incident, on a rural road near the 100 mile marker of Interstate Highway 80 in Dallas County. The area is about 35 miles west of where the two officers were shot.

After Greene complained about a “flare-up” with an existing medical condition, he was taken to Mercy Medical Center in Des Moines. Officials planned to interview Greene after he was released from the hospital.

BEMINIO AND MARTIN:

Law enforcement spent hours combing a 23-acre parcel in Dallas County owned by David Warburton of Redfield, eventually focusing on a particular area near a pond. Warburton said he’d never met Greene and didn’t know why he would have chosen to drive through his field, other than to hide.

Des Moines Police Chief Dana Wingert and Major Steve Waymire, who runs Des Moines’ detective bureau, arrived at the scene around 10:45 a.m. and joined the group walking a perimeter around Warburton’s farm.

It’s not known whether officials found Greene’s vehicle or any weapons.

Police said they don't believe that Greene was specifically stalking Beminio or Martin. But Greene and Martin may have crossed paths.

A neighbor said Greene told him he had called in to help thwart a robbery at a guitar shop. The shop owner said he contacted police, and it was Officer Martin who responded to the call.

'We try to be as vigilant as we possibly can'

Tensions between police and the public have intensified nationwide after several incidents of shootings of unarmed people, some of whom were black. Police have been targeted periodically in the aftermath.

Parizek said officers in the Des Moines area always have in the back of their minds that similar incidents could occur in their community.

“We try to be as vigilant as we possibly can as we go about our business,” he said. “What happened today unfortunately is something we know is a possibility when we sign up for the job. … You can’t let that be your guiding light as you go on about your day.”

Parizek said metro-area officers were relieved when Greene was apprehended.

“Obviously he was targeting police officers,” he said, adding that there was nothing the two slain officers could have done to prevent the shootings.

Urbandale Police Chief Ross McCarty said he doubted that Martin knew that a gunman had approached him. Up to 30 shots were fired at the scene, he said.

Officers talking to dispatchers said the weapon used likely was a rifle.

“There are indications that he (Greene) may have had access to more than one weapon,” McCarty said.

MORE ON SUSPECT:

He said that Urbandale officers have had dealings with Greene.

"They’ve taken trips to his house or delivered service to him," he said.

Urbandale canceled classes at its schools Wednesday at McCarty's urging. He said there had been recent "tensions" between Greene and the school district, where Greene’s daughter is a student.

The most important fact, though, was that Urbandale lost an officer Wednesday, McCarty said.

"I was hoping to finish my career without going through this," he said.

Reporters Charly Haley, Linh Ta, MacKenzie Elmer, Grant Rodgers and Daniel P. Finney contributed to this article.