DES MOINES, Iowa (AP) — A white man with a history of racial provocations and confrontations with police ambushed and fatally shot two white Des Moines-area officers in separate attacks Wednesday as they sat in their patrol cars, authorities said.

Police took 46-year-old Scott Michael Greene into custody hours after the killings and less than three weeks after he argued with officers who removed him from a high school football game where he had unfurled a Confederate flag near black spectators.

Greene flagged down a state Department of Natural Resources employee in a rural area west of Des Moines, identified himself and asked that the employee call 911. Sheriff’s deputies and state patrol officers responded and took him into custody.

He’s suspected in the early morning slayings of 24-year-old Justin Martin, who had been with the force in the suburb of Urbandale since 2015, and 39-year-old Sgt. Anthony Beminio, who joined the Des Moines department in 2005.

Greene was taken to a hospital for treatment of unknown health issues and was to be questioned later at Des Moines police headquarters, Sgt. Paul Parizek said.

Police responded to a report of shots fired shortly after 1 a.m. and found the Urbandale officer. Authorities from several agencies soon saturated the area. About 20 minutes later, they discovered the Des Moines officer, who had responded to the first shooting, Parizek said.

The shootings happened less than 2 miles apart, and both took place along main streets that cut through residential areas.

Urbandale Police Chief Ross McCarty said that in the first shooting, investigators believe the shooter walked up to the officer’s car and fired more than two dozen rounds.

“I wouldn’t call it a confrontation,” McCarty said. “I don’t think he may have even been aware that there was a gunman next to him.”

The shootings follow a spate of police killings in recent months, including ambushes of officers in Dallas and Baton Rouge, Louisiana. Five officers were killed July 7 in Dallas. Three more were killed later that month in Baton Rouge.

Race has been an issue in those cases and others involving unarmed black men killed by officers. Greene is white, as were the officers.

Greene appeared to have issues with people of other races.

In the confrontation at the Urbandale High School football game, which Greene videotaped and posted on social media, he appeared to be trying to antagonize African-American fans when he shook a Confederate flag in front of them during the national anthem, McCarty said.

In the video, officers can be seen asking Greene to leave, telling him that displaying a Confederate flag there was inflammatory. Greene meanwhile argues that his constitutional rights are being violated.

In other incidents, court records show Greene was jailed and charged with interfering with official acts after resisting Urbandale police officers who tried to pat him down for a weapon on April 10, 2014. An Urbandale officer described him as hostile and combative. He entered a guilty plea and was fined.

Two days later, Urbandale police were called to answer a complaint of harassment at the apartment complex where Greene lived. The complaint said he threatened to kill another man during a confrontation in the parking lot and yelled a racial slur used against blacks. Greene was charged with harassment.

He pleaded guilty and received a suspended jail sentence and a year of probation. An officer wrote that Greene had complied with the terms of his probation, noting that he had obtained a mental health evaluation and “reports to have complied with the medication recommendations.” The officer did not elaborate.

Soon after the football game incident, on Oct. 17, a criminal complaint indicates Greene was involved in an altercation with his 66-year-old mother. Greene accused her of scratching and hitting his face. He captured the fight on cellphone video, which he used as evidence of the assault. A judge ordered Greene’s mother to stay away from her son, and she was released on $1,000 cash bond.

The Urbandale police chief said Greene was well-known to the city’s officers.

“Most of the officers in the city have some understanding of Mr. Greene,” McCarty said. “They’ve taken trips to his house, delivered service to him — never anything to this extent.”

It was not immediately clear what led police to Greene. Authorities said only that “a series of leads and investigative tips” helped identify him as the suspect. It was also unclear if either of the shootings was captured on police cameras.

Greene has a daughter who attends Urbandale High School. McCarty said the school had issued trespass warnings while still trying to give Greene some access to the school since his daughter is a student.

The Urbandale shooting occurred near the school, and the city’s entire school district closed for the day.

The attacks on police this summer in Dallas and Baton Rouge came in the wake of several high-profile police shootings of black men, fueling a national debate about police use of force, especially against minorities. It has been a frequent topic in the nation’s presidential race.

Republican nominee Donald Trump has argued that police need the freedom to use greater force. Democrat Hillary Clinton has supported officers while calling attention to what she and others have called examples of bias in policing.

Parizek said the officers’ deaths are a blow to the city.

“They are our friends and co-workers,” he said. “Des Moines is not a big city. We all know each other. We’re heart-broken.”

(Copyright (c) 2024 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.)

Join our Newsletter for the latest news right to your inbox