While a woman knocked on the door of her house, a man was brought in through the window, the sheriff's office announced. The boy told the authorities that another man was waiting near a car in front of the house, reported the Raleigh TV channel.
The man who entered through the broken window grabbed the owner's pellet gun and forced it into a closet of the bedroom, the sheriff's office announced.
The child, described by the sheriff's office as "a star baseball player", left the closet, grabbed a machete and struck a blow to the back of the intruder's head. , reported the station.
"It's a very tough kid who has kept the spirit on him," said Sheriff Charles Blackwood in a statement.
"At the same time, I want to say that this young man, his family and, indeed, this community, are very fortunate that this event did not have a tragic end for the child."
According to the sheriff's office, the man was bleeding profusely. He then dropped the electronic devices from the house and escaped with the other suspects.
After the deputies were summoned home, they provided hospitals in the area with a description of the suspect and his injuries, affiliates reported.
Jataveon Dashawn Hall, 19, of Monroe, North Carolina, was then made aware of the case when he arrived at the hospital with a head injury, announced the sheriff's office.
He faces charges of breaking and entering, second degree abduction and assault of a child under 12 years old upon leaving the hospital, according to authorities.
"Not only has this young man thwarted the thievery attempt, he has created evidence of blood that could very well lead to a conviction in this case," Blackwood said.