A pit bull protected a nine-year-old boy who was home alone during an attempted robbery in Nebraska.

Shane Shafer's mother had left him to go and pick up her other children.

While he was alone, a man with ski mask broke in and Shane called on his dog, Baby Girl, to help.

“I thought it was my mum because I heard someone trying to open the door, and I thought it was her trying to unlock the door with her keys,” Shane told ABC News. “The dude started chasing me upstairs and I called my dog down and they started to fight."

Shane’s pitbull attacked the intruder and then proceeded to chase him out of the house.

The nine-year-old added that he was “really scared”, but his dog did the job.

Shane Shafer (ABC/Screengrab)

“It seemed like he wanted me because when he saw me, he just slowly walked toward me and he didn’t look at anything else. He just kept his eyes on me,” said Shane.

The suspect fled the scene and drove away in a silver car.