One lucky man's best friend is a dog named Buddy.

The homeless man, who's from a remote area in Washington state, suffered a medical emergency and had no way to call for help. He did, however, have his plucky pooch.

The Australian shepherd mix was found by a woman walking her dog on train tracks in the town of Tumwater, with a note attached to its harness. The desperate letter read: “Help. Send help. No joke, cannot walk. Medicine not working. Need doctor.”

The woman called 911 and handed over the plea to the police. The note wasn’t signed so officers were unsure where to look, but they had heard a man and a dog lived in a camp in the woods and were eventually able to find him.

Detective Jen Kolb told KIRO 7 Eyewitness News, “He was absolutely immobile. He was in his camp and couldn’t move from his location. He didn’t have a phone to call anybody. No way to reach out to anybody for help, and he was afraid he was going to die.”

Attaching a note to his trusty friend? A last-ditch effort to contact the outside world. And it worked.

The homeless, but not friendless, man was treated and released from the hospital, and has been reunited with Buddy.