Police in Iowa have captured a man suspected of killing two police officers as they sat in their patrol cars in separate and unprovoked attacks.
Scott Michael Greene, 46, was taken into custody just hours after police named him as their suspect in the ambushes, a police spokeswoman in Urbandale, Iowa said.
Police said they found the first slain officer's body in Urbandale, an affluent Des Moines suburb, and the second about 20 minutes later about 3km away, in Des Moines. Police declined to release the names of the officers awaiting notification of their families.
It was unclear what provoked Wednesday's attacks, Des Moines police department spokesman Paul Parizek told a news conference prior to Greene's arrest, adding that "we may never know." But it appeared the suspect had a recent run-in with police.
A 10-minute video posted on YouTube last month by a user calling himself Scott Greene showed an interaction with officers following an incident at a sports stadium in which he described holding up a Confederate battle flag during the playing of the US national anthem. He is heard claiming that he was assaulted.
Reuters was unable to immediately confirm whether the video was made by the suspect, whose face does not appear in it. It records a male voice arguing with police over the incident.
The Confederate flag is a racially charged symbol for its association with the pro-slavery South in the US Civil War.
US Attorney-General Loretta Lynch urged Americans to avoid jumping to conclusions about the shooter's motive.
"This is a time of particular tension and mistrust between law enforcement and many communities," Lynch said at an event for veterans at the Justice Department in Washington. "There is no message in murder. Violence creates nothing. It only destroys."
Democratic US presidential candidate Hillary Clinton's campaign cancelled an event in Iowa on Wednesday with former US President Bill Clinton and vice presidential candidate Tim Kaine after the shootings.
Republican candidate Donald Trump said on Twitter that he was praying for the slain Iowa officers' families, adding: "An attack on those who keep us safe is an attack on us all."