A puppy tied to train tracks in the California desert narrowly avoided being crushed by an oncoming train. He's now up for adoption.

The 10-month-old poodle-terrier mix was tied to the tracks near Mecca, Calif., earlier this month by a 78-year-old man, officials there say. The engineer of the approaching train saw the man walking away from the tracks and used emergency brakes to stop the locomotive.

Union Pacific special agent Sal Pina arrived on the scene, untied the pooch and detained the man, who "said his family didn't want the dog and didn't know what to do," according to a statement from Riverside County Animal Services.

”It’s probably one of the worst things I’ve seen," Pina said. "I’ve never seen something like this."

Officials did not pursue animal-cruelty charges against the man because he "appeared to be confused or senile and didn't fully understand what he had done." The man was released to his family.

The pup, nicknamed Banjo for old train traffic signals, was taken to the Coachella Valley Animal Campus in Thousand Palms, Calif., where a veterinary technician "examined the dog, treated him and gave him a bath." She even took Banjo home to give him a little extra care.

Those interested in adopting Banjo can email the shelter for more information.