Quentin Patrick, 22, is accused of killing 12-year-old T.J. Darrisaw on Friday night. T.J.'s 9-year-old brother, Ahmadre Darrisaw, and their father, Freddie Grinnell, were injured but were released after being treated at a hospital.
The family attended a Halloween celebration in downtown Sumter, 45 miles east of Columbia, then stopped at Mr. Patrick's house because the porch light was on, police said. Another sibling was with them but wasn't hurt.
Police said at least two of the boys were wearing ghoulish masks when they knocked on the door. The boys' mother and a toddler stayed in the car nearby.
Mr. Patrick emptied his AK-47, shooting at least 29 times through his front door, walls and windows after hearing the knock, Police Chief Patty Patterson said. He told police he had been robbed and shot in the past year.
"He wasn't going to be robbed again, and he wasn't going to be shot again," Chief Patterson said Saturday at a news conference.
She said T.J. suffered multiple wounds, including a fatal shot to his head. No one answered the door at the family's home Saturday.
"This is by far one of the worst tragedies that I have had to personally experience," Chief Patterson said.
Mr. Patrick has been charged with murder, three counts of assault and battery with intent to kill and one count of assault with intent to kill.
Police said they also charged a 19-year-old in his home, Ericka Patrice Pee, with obstruction of justice when she was caught trying to run away after the shooting with $7,500. Chief Patterson did not give an explanation for the money.
Ms. Pee's 2-year-old daughter was inside during the shooting and is now being cared for by family members.
Chief Patterson said police do not believe Mr. Patrick was under the influence of drugs or alcohol. Authorities did not know whether he or Ms. Pee had attorneys. Both are being held without bond.
A man who identified himself as Mr. Patrick's brother but declined to give his name said in a call to The Associated Press that he believed Mr. Patrick was suffering from post-traumatic stress after a break-in last December. The man's account matched the information police provided.
"We want to let his family know that this is a total tragic accident," he said. "He was trying to protect his family."