MAX the boxer might have a thick skull, but nothing that a nail gun can't penetrate.
Tim Horvat said his dog was shot in the head while he was pumping nails into backyard decking he was building.
Just a couple of planks short of finishing the job, he ordered Max to move away.
As he resumed work with the nail gun, Max lunged at it and a steel nail blasted into his head.
"At first I thought I had missed him because he ran behind me," Mr Horvat said.
"But then I saw the tip just protruding from his head and I started shaking as I realised what had happened."
Mr Horvat and his wife, Rose, took Max to a local vet after which he was transferred to the care of surgeon Simon Kudnig at the Melbourne Veterinary Specialist Centre.
Dr Kudnig said it was the first time he had seen a dog injured by a nail gun.
"I was amazed he was still conscious and alert and I kept thinking it must not have gone into his brain cavity," he said.
But stunning X-rays showed the reality: Max had missed death by little more than a hair's width.
"I kept thinking it couldn't be, but the X-rays show the nail skimmed the brain and was in the cranial cavity," Dr Kudnig said.
He knew the nail had to come out, but carefully considered the risks of the delicate surgery.
"You can't just grab the nail and pull it out," he said.
"Craniectomies to remove part of the skull are not uncommon to remove brain tumors, but it was a first to remove a nail," he said.
The operation involved removing a piece of Max's skull and then drilling around the embedded nail to loosen and finally pull it free.