JOHANNESBURG - A baby giraffe that was befriended by a dog after he was abandoned in the wild has died, a South African animal orphanage said Friday. “Our team is heartbroken,” the orphanage said.

Jazz the giraffe collapsed after hemorrhaging in the brain, The Rhino Orphanage said in a Facebook post. “The last two days before we lost him, Jazz started looking unstable on his legs and very dull, almost like he wasn't registering everything,” it said. “He suddenly collapsed and we could see blood starting to pool back into his eyes.”

Resident watchdog Hunter seemed to realize something was wrong and didn't leave the baby giraffe's side, and was there when he died, the orphanage said. The dog then sat in front of the empty room for hours before going to its carers “for comfort.”

Orphanage staff had expected this to happen, assuming that the mother giraffe had abandoned the baby for a reason, Arrie van Deventer, the orphanage's founder, told The Associated Press.

“So we finally know that Jazz didn't have a bad giraffe mother that left him,” the orphanage's statement said. “She just knew. ... But we still have to try every single time (to help) no matter how hard it is.”

The baby giraffe had arrived a few weeks ago, just days after birth. A farmer found him in the wild, weak and dehydrated, and called the centre for help.

The orphanage's Facebook page, which featured several dozen photos documenting Jazz's progress during his weeks at the facility, showed the baby giraffe and his canine friend sleeping side by side on blankets and wandering outdoors together. A final photo showed Hunter sitting in front of the closed door of the room where he and the giraffe had spent time together.

The post had thousands of views and hundreds of comments expressing sadness for the giraffe's passing and concern for how Hunter would handle the loss of his friend.

The two animals bonded immediately, caretaker Janie Van Heerden said.

In its post, the orphanage paid tribute to Hunter's loyalty. “He stayed till the end and said his goodbyes,” it said. “Such a good boy. It added that Hunter was doing well and would continue training to be a tracking dog.

In its farewell to the giraffe, the orphanage said :“You have taught us so much in the last three weeks and we will remember you fondly.”“

The giraffe was buried close to the orphanage, van Deventer said.