Staffordshire bull terrier Ziggy was found in remote woodland near Wansford in Peterborough on Wednesday morning.
X-rays showed the weapon had just missed his skull and vital organs.
RSPCA Insp Justin Stubbs helped a vet "slowly, slowly pull the bolt out" of the sedated dog. "It was a heart in the mouth moment but Ziggy is making a fantastic recovery," he said.
The two-year-old dog had been deliberately shot. It was "a very intentional shot at very close range", the RSPCA said.
It is thought Ziggy only survived by moving his head "at the right time".
An examination of his injuries showed Ziggy had been roaming the woods for a few days, "terrified and in complete agony", before being found by two walkers.
Despite having a 50cm (20ins) carbon fibre bolt embedded from one side of his head to the other, Ziggy was still wagging his tail and wanting people to make a fuss of him, Mr Stubbs said.
However, the vet was faced with the task of removing the weapon.
"It had missed Ziggy's brain, ears, eyes and skull bone by millimetres, but X-rays don't show up major blood vessels," Mr Stubbs said.
"It really was a heart in the mouth moment and hoping for the best, but we had everything in place in case anything happened."
When the bolt was slowly inched out, Mr Stubbs, the vet and a nurse realised it had not hit any blood vessels.
"I don't think anyone took a breath for about a minute. Then there was a collective sigh of relief," Mr Stubbs said.
"It had just gone through soft tissue and didn't even hit muscle."
Ziggy is now being looked after at nearby kennels where he is said to be making "a miraculous recovery".
"He is bounding around as if nothing happened," Mr Stubbs said.
"If ever a dog had a guardian angel, Ziggy had one that day."
The RSPCA is continuing to investigate and has appealed for information about the attack.
The delicate operation to remove a crossbow bolt embedded in a dog's head took "just one minute", the RSPCA said.