David McGoldrick scored a late winner as Sheffield United ran out deserved winners in an entertaining clash with Preston at Bramall Lane.

United had deservedly led 2-0 in the second half and the game appeared dead and buried, before goals from Callum Robinson and Daniel Johnson in quick succession shocked the home side.

But United kept their poise, and McGoldrick atoned for a crucial earlier miss with a composed finish to give United all three points.

McGoldrick was one of four changes made to the United side by boss Chris Wilder, from Wednesday evening’s draw with Birmingham City at Bramall Lane. The striker returned to the side along with Kieron Freeman, Enda Stevens and Billy Sharp, with Leon Clarke, Marvin Johnson, Conor Washington and George Baldock missing out.

Many fans were late to the ground owing to increased traffic around Sheffield city centre as university students moved into their new halls of residence, but United weren’t hanging around and made a quick start to the game.

United, for the first 15 minutes or so, seemed to be camped permanently in Preston’s box and only a few half-chances for Callum Robinson broke the one-way flow of the game.

And the opener duly came when McGoldrick was played through one-on-one with Chris Maxwell, and the striker’s effort found its way into Sharp’s path – all alone in the Preston six yard box. A striker of Sharp’s proven quality was hardly likely to pass up such an opportunity.

United were almost presented with a gift of a second goal early in the second half when Maxwell spilled a routine catch – only to eventually regain the ball, with McGoldrick looming – and the second goal came when the former Ipswich striker won a free-kick from Paul Huntington, who was booked.

Oliver Norwood, back in black boots after debuting his fetching new pink ones in midweek, curled in an inviting cross and Basham took advantage, flicking his header out of Maxwell’s reach and into the far top corner of his goal.

McGoldrick squandered a great chance to make it 3-0 when he received the ball from Mark Duffy’s pass and shot wide on his right foot, and it proved costly when two goals in quick succession got Preston back in the game.

The first came when Robinson confidently finished from Darnell Fisher’s cross, and the second was a little more fortuitious as sub Daniel Johnson netted, via a deflection.

Wilder responded by bringing on Leon Clarke for Duffy, and it was fellow sub Marvin Johnson who helped create the vital third for United. He played a one-two with Stevens and powered past the Preston defence, crossing for McGoldrick who really couldn’t miss.