The Blades began the day six points adrift of safety with two games to play but they looked as if they would take their fate to the final day as they led for much of the second half.
But Danny Haynes' late goal, his second of the game, condemned United to the drop and next season they will be playing third tier football for the first time since 1989.
Haynes' cool finish had put the Tykes ahead in the 15th minute but United rallied and goals from Matt Lowton and Lee Williamson raised hopes of pulling off the great escape.
The late goal by Haynes did not matter anyway as Doncaster and Crystal Palace picked up points, which meant United would have been down even if they won.
For the Barnsley fans, who have had to endure a flat end to the campaign, sending their bitter South Yorkshire rivals down was a moment to savour but they have won just one of their last nine games.
Source: PA
Source: PA