A Wake County sheriff's deputy was shot twice Wednesday morning while serving an eviction notice, the sheriff's office said.

Sgt. Ronald Waller, who has been with the department for more than 20 years, was shot while serving an eviction notice, according to Wake County Sheriff Gerald Baker.

He said the shooting happened at about 10:15 a.m. at the River Birch Apartments off of Old Wake Forest Road. 

"This deputy was executing a civil process," sheriff's office spokesman Eric Curry said. "During that attempt, he was shot."

Raleigh Police Chief Cassandra Deck-Brown said Eddie Dewain Craig, 32, surrendered after the shooting.

Raleigh police charged Craig with three counts of attempted murder, three counts of assault on a law enforcement officer with a firearm, two counts of assault with a dangerous weapon with intent to kill, and one count of assault with a dangerous weapon with intent to kill inflicting serious injury.

Craig is being held on a $4-million bond.

Wake County Sheriff Gerald Baker said Waller and another deputy opened the door partially and identified themselves.

Craig tried to close the door on them before allegedly shooting at the deputies with an assault-style rifle from inside the apartment, Baker said during an afternoon news conference at WakeMed.

The Raleigh police chief said her officers were able to extract Waller from the apartment and started driving away before moving him to an ambulance.

The Raleigh Police Department is in charge of the investigation of the shooting because it happened within city limits, Curry said. 

The State Bureau of Investigation and the sheriff's office will also investigate the shooting.