A dog in Sao Paulo, Brazil refuses to leave the entrance of a hospital over four months after his owner died. (Cristine Sardella, Facebook)

A loyal dog is refusing to leave the entry of the hospital in Sao Paulo, Brazil where his owner died over four months ago, hospital staff says.

The dog, who has no name, arrived at the Santa Casa de Novo Horizonte hospital after chasing the ambulance that was transporting his owner, a 59-year-old homeless man, according to local media. The man was stabbed in a street fight and later died at the hospital.

That was over four months ago, but the dog still remains at the hospital's entrance, supposedly waiting for his master.

A local resident, Cristine Sardella, shared two images of the dog last month on Facebook, where they went viral.

The faithful dog has earned affection from the hospital employees, who give him food and water. "He's extremely tame, docile and quiet," says the hospital's financial director.

The hospital staff says the dog will sometimes go out in search of more food, but always comes back.

"It's sad to know that he will never see his owner again and will not understand what happened," Sardella told The Dodo. "The only thing left is to wait at the last place where he saw him."

According to The Dodo, a hospital staffer has decided to adopt the dog when the time is right. In the meantime, they are arranging for the dog to see a veterinarian and receive vaccinations.