Authorities in Iowa have captured the suspected gunman in the ambush-style attacks early Wednesday morning that claimed the lives of two police officers who were sitting in their patrol cars.

Officers arrested 46-year-old Scott Michael Greene without incident in Dallas County, west of Des Moines, police told Fox News. The Iowa State Patrol and Dallas County Sheriff's Dept. took part in the arrest.

Greene was spotted alone on foot on a roadway at the time of his arrest. Police said he surrendered to a state Department of Natural Resources officer without incident.

Greene is suspected in the shooting deaths of Urbandale officer Justin Martin, with the force since 2015, and Sgt. Anthony "Tony" Beminio, who joined the department in Des Moines in 2005.

Martin was single. Beminio was married with children.

EX-FBI MAN: ANTI-COP FERVOR PUTS BLUE LIVES IN DANGER

The shootings appeared to be the latest cases of police officers being targeted for assassination in a year that has seen 113 police officers killed in the line of duty, including 50 by gunfire, according to the Officer Down Memorial Page.

Gov. Branstad, @IALtGov have been briefed by @IowaDPS on early morning attack on 2 police officers - https://t.co/NO0CZlEnhR #iagov — Terry Branstad (@TerryBranstad) November 2, 2016

Officers first responded to a report of shots fired at 1:06 a.m. and found an Urbandale Police Dept. officer who had been shot. Authorities from several agencies raced to the area after that shooting, and about 20 minutes later discovered that a Des Moines officer had been shot in a patrol car at an intersection. The shootings happened less than 2 miles apart and both took place along main streets that cut through residential areas.

FLASHBACK: POLICE FACE HEIGHTENED THREAT OF AMBUSH

“In all appearances it looks just like... these officers were ambushed,” Parizek said. “It doesn't look like there was any interaction between these cowards and the officers they shot in their cars.”

Court records show Greene was jailed and charged with interference with official acts after resisting Urbandale police officers trying to pat him 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. He was charged with harassment.

He pleaded guilty and received a suspended jail sentence and a year of probation. Court records show he completed a substance abuse and psychological evaluation.

Urbandale Sgt. Chad Underwood said his officers are equipped with body cameras, but they are not always on.

Asked at a news conference about a video on social media that appeared to show a man identified as Greene being removed from a high school football game, Parizek said he was aware of the video but hadn't seen it and couldn't comment.

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

The Des Moines Register reported that streets at both shooting scenes were closed amid the investigation. Schools in the area were also closing for the day, officials said.

The Des Moines police officer is believed to be the first from the city to be shot and killed on duty since two officers were gunned down in separate incidents in 1977, according to the Register. Two Des Moines police officers were killed earlier this year when their car was struck head-on by a wrong-way drunken driver, according to the paper.

The Urbandale police officer is believed to be that department's first to be shot dead in the line of duty, Underwood said at the news conference.

The Associated Press contributed to this report.