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.

Shadow leader of the house Valerie Vaz joked that cries of "Don't panic! Don't panic!" were being heard around 10 Downing Street as the government tries to organise its policies on Brexit.
Commons Leader David Lidington speculated that his Labour opposition "don't like it up 'em'".
Mr Perry, who also created sitcom Hi-de-Hi, died on Sunday aged 93.
During the business statement, Ms Vaz said she grew up watching Dad's Army, adding: "It struck me that you could hear those catchphrases ringing around Number 10, so we hear the cry of 'Don't panic! Don't panic!'
"Or as the Prime Minister slaps down her recalcitrant and wayward colleagues you can hear her muttering 'stupid boys'.
"When you ask their position on Brexit, the infamous 'don't tell 'em Pike!'."
Mr Perry worked with the late producer David Croft and the pair were also responsible for It Ain't Half Hot Mum, Hi-de-Hi and You Rang M'Lord?
Commons Leader David Lidington also paid tribute to Mr Perry, who often wrote the theme tunes to his shows.
He said: "I thought it was a wonderful gesture when outside Buckingham Palace earlier this week the military band in the changing of the guards ceremony played the theme tune to Dad's Army as a tribute.
"But I do think when I look across at the Opposition, in particular when I look at their faces during Prime Minister's Questions, the phrase that comes into my mind is 'they don't like it up 'em'."
The SNP's Commons leader Pete Wishart also chipped in, saying: "I would hate to say that we are all doomed but perhaps we are under this particular Government."
TV references also came up in the Commons on Wednesday at Prime Minister's Questions when Jeremy Corbyn likened Theresa May's plan for the UK leaving the UK as one of Baldrick's "cunning plans" from the Blackadder series.
The delicate operation to remove a crossbow bolt embedded in a dog's head took "just one minute", the RSPCA said.
[NEXT_CONCEPT]
MPs have paid tribute to Dad's Army creator Jimmy Perry, using his show's famous catchphrases in the Commons.