Jeff Luptak, 45, said he felt no pain after the accident last week in Bismarck, North Dakota,USA but was convinced he was going to die.
Even doctors were amazed that he was still alive when he was rushed to hospital where an X-ray showed just how far the nail had penetrated into his skull.
The nail had missed all the major arteries and was lodged between his brain’s left and right hemispheres.
The Daily Mail reported that one doctor told him: “Leave it in, it’ll rust and you’ll die of infection. Pull it out and you’ll bleed to death.”
A surgical team led by neurosurgeon Dr Eric Nussbaum at the National Brain Aneurysm Center in St Paul, Minnesota, took more than an hour to remove the nail.
Dr Nussbaum said: “He was very lucky. I mean this is a potentially fatal injury depending on what structures it hits on the way.”
Luptak was working on a site in Bismarck when he asked a colleague to hand him a 16 gauge nail gun.
As he grabbed the gun he heard it go off and felt a stinging sensation in the back of his head.
The co-worker began shouting that Luptak had been shot with the gun – but Lupak said he only felt a slight pressure in the back of his head.
After being taken to a hospital in Bismark he was flown to St Joseph’s Hospital in St Paul where neurosurgeons were waiting to carry out an operation to remove the nail.
The operation proved a success and Luptak is recovering in hospital with his only problem moving his left toes and ankle.
Doctors have said he will make a full recovery. Luptak, a construction worker for 28 years, admitted he was lucky to be alive.
“Somebody was looking out for me,” said the husband and father of three daughters.