Boro win 5-4 on penalties
Middlesbrough needed penalties to beat Bristol City of League One to secure a place in the FA Cup fifth round.
Boro held their nerve to reach the fifth round of the Cup
Yakubu missed two penalties - one in extra time and one in the shoot-out - before Adam Johnson stroked Boro's sixth spot-kick past Chris Weale.
David Noble beat Mark Schwarzer to give City a first-half lead, before Mark Viduka headed home on 68 minutes.
Yakubu then put Boro ahead with a close range finish early in extra time, only for Jamie McCombe to volley in late on.
Middlesbrough manager Gareth Southgate initially opted to play several fringe players - Fabio Rochemback, Seb Hines and Malcolm Christie to name but three - leaving Viduka to twiddle his thumbs on the bench.
It was an experiment that unravelled in the opening half as Boro all too often failed to impose themselves on their visitors with far too many passes going astray.
While Boro struggled to find some sort of rhythm, City settled into their own tidy passing game, an approach that reaped its reward midway through the first half.
Schwarzer proved to be Boro's hero in the shoot-out
Alex Russell dissected the Boro defence with a superb pass as Andrew Taylor's failure to move up played Noble onside.
Noble's shot was partially saved by Schwarzer, but it had sufficient power to cross the line.
At the start of the second half Viduka and Andrew Davies replaced Christie and Hines as Southgate reverted to a more experienced line-up.
Viduka's introduction immediately provided Boro with more of a cutting edge.
606 DEBATE: Your reaction to Boro's victory
Within the first 15 minutes of his introduction, the Australian had had two shots on goal as well as setting up a chance for Yakubu.
Having tried to equalise by shooting, Viduka opted to use his head to pull Boro level.
The City defence left the Boro striker unattended as they rushed out following a corner allowing Viduka all the space he needed to glance a header past Weale.
Boro were now in total control and in the space of a couple of minutes Stewart Downing crashed a shot against the post, while Johnson rattled the bar with a rising drive.
But City held out to send the game into extra-time.
Early in the first period, Yakubu missed a golden opportunity to give Boro the lead when he hit his penalty straight at Weale after the Nigerian had been brought down by McCombe.
The Boro striker proved less merciful when Weale was unable to hold Johnson's shot allowing Yakubu to sidefoot home and put the home side ahead for the first time in the match.
Schwarzer had been a virtual spectator for much of the game after Noble's goal, but with four minutes left the Australian keeper found himself picking the ball out of the net for a second time.
McCombe made up for his ill-judged tackle on Yakubu in the most spectacular fashion when his scuffed volley from Scott Murray's cross beat Schwarzer.
During the penalty shoot-out, Phil Jevons missed City's first spot-kick, but Yakubu also missed for Boro when he had the chance to clinch the game.
City's sixth penalty was saved by Schwarzer, with Johnson's penalty finally securing Boro's place in the fifth round where they will meet West Brom at home on Saturday.
Middlesbrough boss Gareth Southgate:
"I'm delighted with our character, it could have been one of those nights where it didn't go for us.
"There were plenty of setbacks during the match. But we kept plugging away.
"Credit to City, over the two games they've pushed us all the way. It was an unbelievable tie, but we managed to keep our nerve in the end."
Bristol City manager Gary Johnson:
"Nobody that is associated with Bristol City can be too downhearted given our performance.
"We're clearly not happy to be out of the cup especially when we took it as far as we did.
"We are proud of our lads, however, and especially the comeback at the end when their legs looked like they'd gone."
Middlesbrough: Schwarzer, Hines (Davies 46), Pogatetz, Xavier, Taylor, Cattermole (Johnson 68), Rochemback, Boateng, Downing, Yakubu, Christie (Viduka 46).
Subs Not Used: Jones, Euell.
Goals: Viduka 69, Yakubu 102.
Bristol City: Weale, Orr, McCombe, Keogh, Fontaine (Partridge 106), Murray, Russell, Johnson, McAllister (Woodman 43), Noble (Myrie-Williams 88), Jevons.
Subs Not Used: Thomas, Artus.
Booked: Orr, Russell.
Goals: Noble 23, McCombe 117.
Ref: P Dowd (Staffordshire).