James Vaughan's 82nd-minute equaliser appeared to have consigned Barnsley to League One, but Crystal Palace's 89th-minute winner against relegation rivals Peterborough meant both Yorkshire sides stayed up.
Huddersfield twice hit back from behind to clinch a 2-2 draw and the point they needed to guarantee Championship football next season.
Jermaine Beckford cancelled out Chris O'Grady's first-half opener and Vaughan silenced the visiting hordes after substitute Jason Scotland had headed Barnsley into a 75th-minute lead.
Once news of Palace's late winner had filtered through, it triggered bizarre scenes on the pitch, where both sets of players swapped handshakes and appeared to agree to play out the final few minutes without further incident to ensure both sides avoided the drop.
"It was the hardest 90 minutes that I've ever had to endure without a doubt," said former Barnsley boss Robins, who replaced predecessor Simon Grayson in February. "It was always going to be difficult.
"By no means were we at our best. We were a million miles from our best, but we got what we needed at the end of it.
"The game doesn't really matter. It was the outcome that counted. When you've got a cup final, you've just got to get wehat you need.
"I'm sure throughout that game we were fluctuating between relegation and survival and we've just managed to get our 58th point, which is an absolutely unbelievable total to be talking about anywhere near relegation."