A dog has been hailed a "true hero" after he died protecting his owners and other walkers from a bear while out hiking in New York State.

Pete, an English setter, stood his ground after disturbing the black bear while out with walkers and other dogs.

Twitter user Ben White posted: So our friends lost their sweet setter Pete today.

He and some other dogs surprised a black bear while on a hike.

Pete bravely protected the rest of the crew who got to safety. Pete later succumbed to his injuries. He was an older guy and went out a true hero. RIP PETE THE HERO!

The post garnered thousands of replies, with one person writing: Condolences to Pete’s human family. Your courageous warrior saved others before crossing the Rainbow Bridge. Rest now without pain, sweet Pete.

Another simply said: We don’t deserve dogs.

On Instagram, Me and My Shadow Pets, which is understood to have adopted Pete, explained what happened.

Today we lost our brave, old man Pete, they said.

The dogs surprised a black bear just off the trail while we were hiking this morning. It must not have heard or smelled us with the pouring rain.

It felt threatened and turned around. Pete stepped up and held off the bear until I could get the other dogs to safety.

The post said that once the other dogs were safe, walkers managed to scare the bear away before taking Pete to get treatment, but he was gravely injured.

The post continued: He held on like a real trooper the whole time, and he was never alone in his pain. The x-rays revealed some pretty bad spinal damage that would mean he could never walk again, if he survived all the surgeries (not a certain thing at his age).

We decided it was best to let him go this afternoon.

Run free Pete, you no longer have all those aches and pains of old age. You had a great 18 months with us running the days away like you loved.

Me and My Shadow Pets wrote a tweet thanking people for their messages.

My husband and I want to thank everyone for the outpouring of love for #petethehero. He was a senior dog that we adopted after fostering. His actions prove that no dog is too old to be abandoned or too lost to be loved. #oesr #rescuedogs #rainbowbridge.

(c) Sky News 2018: Hero dog Pete dies protecting owners from bear in New York State