WASHINGTON — Alan Arellano and Matt Taylor were hiking the Macricostas Preserve in New Preston recently when Arellano’s dog, Ozzy, had enough.

Halfway through the planned 3-mile hike, the dog turned back the way they had come.

“He kinda said, ‘You know what, guys? I’m out of here,’ and boogied on out of there,” Taylor said.

Taylor and Arellano gave chase, catching up with the 8-year-old golden retriever when the dog stopped and sat down.

Ozzy was suffering from heat exhaustion, “in rough shape” some 1.5 miles from the trailhead, Taylor said.

Arellano called for help and Taylor went to search for it.

Within minutes of getting the emergency call, Fire Chief Darryl Wright was at the trailhead. Other firefighters arrived and headed up the trail, carrying a bag of ice, water and towels, Wright said.

An engine equipped with oxygen masks designed for pets was on the way. The masks were donated last spring to the Washington Volunteer Fire Department. When the engine arrived at Macricostas, firefighters whisked the mask up the trail and gave Ozzy some oxygen.

The volunteers fashioned a stretcher from a blanket, brought Ozzy down the path and drove him to Aspetuck Animal Hospital.

Ozzy left the hospital that afternoon and was fine the next day.

Taylor and the firefighters credit Luke Cheney, a 2017 Shepaug graduate, with helping to save Ozzy’s life.

Cheney’s generosity and his passion for firefighting — he became a volunteer on the force this summer — were the reasons his senior project focused on acquiring the pet oxygen masks he later donated to the department.

Cheney spent his senior year raising money and donated seven mask kits — one for each fire engine.

“I picked pet oxygen masks because I love pets,” Cheney said. “I think it’s worth every penny that I spent. I helped save that pet’s life.”

Taylor called the incident a “wonderful story.”

“Everybody in that community just jumped right in,” he said. “I hope it encourages other young people to make a difference in any small way.”

blytton@hearstmediact.com; 203-731-3411; @bglytton