Diafra Sakho marked his return to fitness by heading West Ham United into the FA Cup fifth round with a 1-0 win against League One high-fliers Bristol City at Ashton Gate.

Sakho was named on the bench for West Ham following a back injury and marked his first appearance since New Year’s Day with the winner.

The Hammers were some way off their best in the first half and could have fallen behind on more than occasion as Steve Cotterill’s side enjoyed the best of the chances.

However the second-half introduction of Sakho and Morgan Amalfitano from the bench saw the Hammers seal their place in Monday night’s fifth-round draw nine minutes from time.

The Robins made a bright start and could have been ahead after just six minutes. Matt Smith got up highest to nod a Luke Freeman corner towards goal, with Mark Noble leaping well to head off the line.

City goalkeeper Frank Fielding had to be alert just before the quarter-hour mark, racing off his line to clear away from Noble in the corner of his 18-yard box.

Left wing-back Joe Bryan was a threat throughout and combined well with Jay Emmanuel-Thomas to work a shooting opportunity but dragged his left-footed effort out for a throw on.

Four minutes later Smith had another header from a corner cleared off the line, with Andy Carroll in the right place at the right time to deny the Fulham loanee – possibly with his hand.

A rare West Ham chance fell to Carroll before the break, the big number nine only diverting Carl Jenkinson’s right-wing cross into the arms of Fielding from six yards.

Unimpressed by the start his side made to the second period, Sam Allardyce introduced Sakho and Amalfitano in place of Enner Valencia and Alex Song after 12 minutes.

Chances were at a premium until the final 20 minutes, with Smith’s header over the bar from a Bryan cross as good as it got for either side until that point.

In the 74th minute Sakho raced onto Aaron Creswell’s ball down the left, hooked it over the head of Luke Ayling and let fly, the shot skimming the crossbar.

Ayling then headed comfortably over the bar, whilst Amalfitano was unable to trouble City keeper Fielding with an effort from 25 yards.

But with nine minutes remaining the Hammers grabbed the game’s only goal. Carroll did well to hold up Derrick Williams down the right before hanging a right-footed cross up for Sakho to head in at the far post.

Targetman Smith saw three further headed chances go astray, nodding agonizingly wide in injury time after meeting Emmanuel-Thomas’ centre with a firm contact.

West Ham will discover their fifth-round opponents on Monday night, with the draw set to take place at around 7.20pm on BBC One.

Bristol City: Fielding; Ayling, Flint, Williams; Little (Wagstaff 75), Smith (c), Saville (Pack 83), Bryan; Freeman (Agard 82); Emmanuel-Thomas, Smith.

Subs: Osborne, Elliott, Richards (GK), Cunningham.

West Ham United: Adrian; Jenkinson, Reid, Tomkins, Cresswell; Song (Amalfitano 57); Noble, Nolan (c) (Demel 88); Downing; Valencia (Sakho 57), Carroll.

Subs: Jarvis, Jaaskelainen (GK), Poyet, Cole.

Referee: Lee Mason.

Attendance: 12,682.