A seventh-grader from Salisbury, Maryland, is lucky to be alive after surviving a freak accident that saw a 6-inch screw lodged in his skull, actually piercing his brain.

13-year-old Darius Foreman was helping his cousins build a treehouse when he fell to the ground, followed by a 5-foot-long (1.5 metre) wooden board that landed on his head and became affixed to it – courtesy of a huge construction screw.

Understandably, the boy was confused when he got to his feet and began wandering around the yard – with the board still nailed to his head – which was how his aunt found him moments later.

"I thought something was stuck in my hair," he told Delmarva Now.

His aunt made him lie down on the ground while she called 911, but even as paramedics arrived, nobody could have guessed just how dangerous Darius's predicament truly was.

724 screw brain boy 2(Alan Cohen/Johns Hopkins Medicine)

The screw's sharp tip hadn't just perforated the teen's skull, but had penetrated through to his brain, entering what's called the superior sagittal sinus.

This large vein, located right between the two halves of the brain, channels blood from the organ away to the heart – and if it were ruptured by the screw, a fatal haemorrhage could result.

"He was a millimetre away from having himself bleed to death," paediatric neurosurgeon Alan Cohen from Johns Hopkins Medicine explained to CNN.

Clearly the screw had to go, but first there was the problem of the board to deal with.

The 5-foot plank stuck to Darius's head was so long that first responders to the scene couldn't squeeze the patient into the ambulance. Making do, they used a handsaw to cut the board down to 2 feet in length, and transported him to a local medical centre.

After an initial X-ray, the decision was made to airlift him to Johns Hopkins Hospital in Baltimore for surgery, but again, the board was making patient transport difficult – requiring medical workers to borrow a Maryland State Police helicopter, because the hospital's helicopter wasn't large enough.

In surgery, Cohen's wife, fellow neurosurgeon Shenandoah Robinson, cut away what was left of the board and the top of the bolt, freeing up her husband and his team to tackle the sensitive screw removal.

"The danger was where it was located," Cohen told Delmarva Now.

"That's what made this injury so serious – that fact that he could have exsanguinated [suffered major bleeding] … like a ticking time bomb."

724 screw brain boy 2(Alan Cohen/Johns Hopkins Medicine)

Fortunately, some seven hours after Darius first became impaled upon the loose plank of a treehouse, the doctors were able to remove the screw – along with tiny fragments of bone and a small blood clot that formed due to the injury.

The procedure called for some extra-delicate surgery, the doctors said.

"If we were to unscrew it, there could be torrential haemorrhaging," Cohen explained to WJLA, explaining how the team had to drill through the skull to the left and right of the screw.

"We carefully drilled the bone away down to the dura, the linings of the brain, so that we could manipulate the screw."

To replace the missing bone fragments, the team installed a titanium plate in Darius's skill, and also gave him what was left of the screw – a memento of his up-close brush with death.

724 screw brain boy 2(Alan Cohen/Johns Hopkins Medicine)

He was discharged on Thursday, a date that just happened to be his 13th birthday.

The hospital staff decorated his room and even threw him a party – capping a pretty fantastic turn of events that could so easily have ended very differently.

"I think a millimetre made a difference in this kid whether he was going to live or die," Cohen said.

"You wouldn't know that this happened to him… It's a story with a happy ending."