Half-time sub Oli McBurnie was the Blades' hero as he kept his cool to convert a penalty in the 13th minute of stoppage time, after being clattered by Hammers goalkeeper Alphonse Areola four minutes or so earlier.
Earlier Ben Brereton Diaz had cancelled out Maxwel Cornet's opener with a goal on his Premier League debut but James Ward-Prowse looked to have won it for West Ham with a 79th-minute penalty, after Gus Hamer brought him down. Blades sub Rhian Brewster saw red for a out-of-control challenge on Emerson Palmieri but United stuck to their task and got their reward deep into stoppage time.
Here's how we rated the Blades' players on a topsy-turvy afternoon...

9. James McAtee 7
Didn't have a poor first half by any means but improved much in the second, when a delicious cross early in the second half was begging to be converted but McBurnie just couldn't quite stretch far enough. Looked a threat cutting in on his left foot from the right and a lovely pass sent Brereton Diaz clear on goal but the striker couldn't find the finish to match | Getty Images

10. Ben Brereton Diaz 7.5
On his home debut for the Blades, and his first game in the top-flight, it was perhaps a measure of the loan man's mentality when he went through one-on-one with Areola and instead of trying to finish for a dream debut goal, he squared to Osula instead. As it happened Osula's shot was saved by Areola, and the flag went up for offside anyway, but Brereton Diaz's moment duly arrived on the stroke of half-time when he followed up Areola's save to punch home a vital debut goal. He was frustrated soon after when Osula didn't return the compliment when he was well placed, electing to shoot instead, before squandering a huge chance for 2-1 after being sent clear by McAtee just before the hour mark when perhaps a bit of ring-rust started to show. Replaced by Archer and loses a mark for his big miss | Getty Images

11. Will Osula 6
Retained his place after his first senior goals for the Blades last time out against Gillingham in the FA Cup and clearly fancied his chances of adding to them, with some audacious efforts from long-range and an almost impossibly tight angle suggesting his confidence levels were high. He was close to getting on the scoresheet again when his header was well saved by Areola but Brereton Diaz was in the right place at the right time for the follow-up before Osula made way at the break for Oli McBurnie | AFP via Getty Images

12. Subs: Oli McBurnie 7.5
Came on for Osula at the break and had a couple of half-chances, including one from a tight angle soon after coming on that went over the bar. But then had a pivotal part to play as he was clattered late on by Areola and then impressively kept his nerve to fire home past Fabianski Photo: Simon Bellis

