The family attended a Halloween celebration in downtown Sumter, 45 miles east of Columbia, then stopped at 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.
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," Patterson said Saturday at a news conference.
She said T.J., a bright young man, 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," Patterson said. "It happened basically because kids were out doing what they would normally do on Halloween."
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 in cash. Patterson did not give an explanation for the money.
Pee's 2-year-old daughter was inside during the shooting and is now being cared for by family members.
Patterson said Patrick had multiple drug convictions but police do not believe he was under the influence of drugs or alcohol during the shooting. Authorities did not know if Patrick or Pee had attorneys. Both are being held without bond.
A man who identified himself as Patrick's brother but declined to give his name said in a call to The Associated Press that he believed 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."
Patrick's home is off a busy, two-lane road in Sumter, a city of about 40,000 people. On Saturday, shattered glass still covered the front stoop and about 20 bullet holes peppered the front door and a front-window casement.
The shooting shocked residents of a neighborhood where most people know each other well.
"I just hate it that that little kid got killed. It used to be the quietest place. I knew everybody and everybody knew me," said Vivian Johnson, 81, who lives two doors from Patrick and Pee but said she did not know them.
County Councilman Charles Edens said he lives just a few blocks away and passed the crime scene on his way back from trick-or-treating with his 13-year-old daughter, who was upset by the news.
"It's going to put a dampening on Halloween," Eden said. "I would think twice about going to a door that we don't know who lives behind."
Associated Press Writer Katrina A. Goggins in Columbia contributed to this report.