A 13-year-old South Carolina boy fatally shot one burglary suspect and scared off a second with his mother's gun, police said.

The unidentified teenager told the Charleston County Sheriff's Office that he was alone on Tuesday afternoon in his family's home, north of North Charleston, when someone tried to break in, according to NBC affiliate WCBD.

The boy grabbed his mother's gun, and then waited at the back door of the home, the station reported. Police say the boy fired repeatedly through the door, and someone outside shot back.

Ira Bennett, left, and Lamar Brown. Charleston County Sheriff's Office

The suspect was hit three times, and a getaway driver rushed him to a hospital in Charleston, where he died of his gunshot wounds, according to an affidavit. A gray Chevy Sonic used in the incident was found with bullet holes, and a gun was retrieved from the home's backyard, the affidavit said.

A neighbor sitting in his driveway with his girlfriend during the alleged break-in described a burst of gunfire coming from the home.

"We heard like four or five gunshots coming from the back and then a car came creeping from the backyard," John Griffin told WCBD. "It went slow and then the dude went in the front door and he just started shooting his gun, so I ducked down and (my girlfriend) ran in the house."

The burglary suspect was identified by authorities as Lamar Brown, 31. His rap sheet includes six felony drug charges and an unlawful carrying of a weapon charge.

Related: Man Arrested After Home Invasion in Which 11-Year-Old Killed Teen Intruder

His alleged partner, Ira Bennett, also 31, was apprehended and charged with first-degree burglary and possession of a weapon during a violent crime. He made a court appearance Wednesday.

A sheriff's deputy on Wednesday asked the judge to deny bond on the burglary charge because of "the serious nature of this crime. Unfortunately, we lost an individual who died, a 13-year-old child lost his innocence after having to fire."

Bond was denied on the burglary charge, but Bennett was given a $50,000 bond on the weapons charge, the station reported.

Following the incident, the boy's mother told The Post and Courier newspaper that she taught her children to be prepared.

"I tell my kids that if anything ever happens to call 911, but I also tell them to protect themselves if they have to," the teen's mother said. "I never would have dreamed that this would have been a part of our day today."

Correction: An earlier version of this story said Bennett was wounded. He was not wounded; the unidentified boy scared him away.