The 11-year-old boy hid behind his bedroom door when he heard a stranger bust into his home in Mebane, N.C.

Braydon Smith was home alone, as he told WFMY, and it wouldn’t take long for the burglar to find him there. The intruder threw open the door, pointed a pellet gun at him and “told me to sit down on the ground and get in my closet,” Braydon said, “and I did that.” But Braydon started to worry. What if the invader came back? What if he kidnapped him?

“I knew I had to act in the heat of the moment,” he told ABC11.

So, he grabbed his machete.

The little-league slugger had purchased it with gift cards and normally used it to chop trees, he told ABC11. But now here he was, sneaking through his living room like a fearless Kevin McCallister of “Home Alone” fame, waiting for the chance to strike. It came when he saw the intruder drop the boy’s cellphone.

“That’s when I picked up my machete and hit him in the back of the head,” he said.

The plan worked. The intruder, later identified by police as 19-year-old Jataveon Dashawn Hall, was bleeding badly from his head onto Braydon’s floor. He kicked Braydon in the stomach and in the side of the head as the 11-year-old took another swing and missed, the Orange County Sheriff’s Office said in a statement Friday. Hall attempted to grab a PlayStation and television but stumbled, realizing how badly he was injured, the sheriff said. He fled out the door to a getaway car.

The chase seemed like it would be easy enough when Hall showed up at a hospital for medical treatment a few hours later. Instead, the story of the 11-year-old’s machete-wielding heroics was temporarily spoiled after Hall waltzed out of the hospital Friday night, leading to a two-day manhunt.

Hall was finally recaptured at his mother’s apartment in Burlington, N.C., on Sunday afternoon and charged with breaking and entering, kidnapping, assault on a child under 12 and interfering with emergency communications. But his brief escape from the hospital has left the Orange County Sheriff’s Office and the University of North Carolina Medical Center playing the blame game, trying to figure out how a suspect slipped away so easily.

“It was infuriating,” Braydon’s mom, Kaitlin Johnson, who lives out of state, told ABC11. “I just have so many questions.”

Johnson said she was on the phone with her son on Friday morning when he told her that an unfamiliar car had just pulled into the driveway and that unknown people were coming to the door. Johnson said she summoned a relative to call 911 when her son realized that one man — allegedly Hall — was breaking in. “It was horrifying,” she told ABC11.

The intruder and two others, who have not been identified, had taken off before police could get there.

Bleeding from the back of his head, Hall walked into the University of North Carolina hospital in Hillsborough about two hours later, at 1 p.m. Hospitals had been warned to look out for a man matching his description who would be suffering from a head injury — and UNC’s hospital staff promptly notified the sheriff’s office when Hall arrived.

Hall’s condition worsened throughout the afternoon, and he was transferred about 20 minutes south to the university hospital in Chapel Hill. There, according to the sheriff’s office, the plan was for hospital staff to notify deputies when Hall was ready to be discharged so he could be arrested.

But that call never came, the sheriff now claims. Instead, it was nearly 10 hours before police realized Hall was gone.

An Orange County sergeant found out when he called the hospital to ask about Hall’s status at 5:53 a.m. on Saturday. About a half-hour later, hospital police called him back to inform him that Hall had “left the hospital against medical advice” on Friday around 8 p.m. The nurse had written in her notes that Hall said he “needed to leave because police were going to be looking for him.” He left looking conspicuous, wearing a hospital gown with blue socks and a bandage around his head, carrying a cup of water.

“When Hall left the hospital Friday evening against medical advice, we certainly should have been notified,” the sheriff’s statement said. “But most concerning of all is that hospital police did not even know Hall had left the premises almost ten hours prior. Indeed, Hall’s absence was only discovered when we placed a phone call to them.”

Hospital officials could not be reached for comment late Sunday but told CNN in a statement that the hospital’s emergency department was slammed on Friday night — and their primary role is medical care, not police work. The hospital also noted that the Orange County Sheriff’s Office did not station any deputies at Hall’s hospital room.

“We believe this situation highlights the issue that emergency-department nurses and physicians cannot be both caregivers and law enforcement at the same time,” the hospital said in the statement. “Our nurses and physicians focus 100 percent of their time on providing care to patients — that is their job."

Hall was taken into custody Sunday at his mother’s home after police in Burlington received an anonymous tip that he had fled there from the hospital. He is being held at the Orange County Detention Center on a $100,000 secure bond and awaiting a court hearing Monday. No attorney could be located for him.

Braydon is already settling back into his regular routine, telling local media outlets that he wasn’t afraid throughout the ordeal.

Braydon’s father, Christopher Smith, told WFMY that his son had only one concern after the burglary. “He was like: ‘Am I still going to be able to play baseball? Can I get back into the house to get my uniform?’ ” Smith said. “I was like, ‘Heck yeah, dude. We’re going.’ ”

The 11-year-old slugger said his father had prepared him for what to do in the event of a home invasion after it was burglarized several years ago, teaching him to “stay calm,” he told the news station.

The boy had a message for parents: “Always have your kids prepared for anything.” He had a message for the intruder, too.

“You shouldn’t have done what you’ve done,” Braydon said to ABC11. “You’re better off to get a job than breaking into other people’s house.”

More from Morning Mix:

Trump, a self-professed germaphobe, told his chief of staff to leave the room during an interview to cough

She wanted to be a judge. To explain why, she allegedly plagiarized from Neil Gorsuch.

‘I’ll call your bluff any day of the week’: Ocasio-Cortez rejects Trump quoting her to defend against his impeachment