A DeKalb County man accused of shooting a sheriff's deputy during a 2010 standoff pleaded guilty Monday, opting for a 20-year prison sentence.

Joshua Matthew Waller was also sentenced to 20 years' probation after he pleaded guilty to two counts of attempted murder, four counts of aggravated assault, simple assault, terrorism and gun possession.

"He had a total disregard for the law, law enforcement officers and the people in his community," DeKalb District Attorney Robert James said after the sentencing hearing Monday.

According to court officials, Waller, 36, shot at two DeKalb County Sheriff's deputies, hitting one in the arm on Nov. 16, 2010, when they came to serve an arrest warrant for threatening his neighbors.

Waller overpowered deputies Gary Freeman and Sonya McKinney when they tried to handcuff him, fled to a bedroom in the condominium where he was staying and returned with a gun, authorities said.

Court officials said Waller pointed the gun at Freeman, who was still picking himself off the ground from the scuffle. McKinney shot at Waller, hitting him in the chest, and Waller shot Freeman in the arm, authorities said.

The deputies retreated and called for the sheriff's SWAT team, court officials said.

While he held police at bay, Waller shot several times into the adjacent condo of the neighbors but didn't hit them, authorities said. He eventually came out and surrendered to police.