Boro are through to the quarter-finals of the Emirates FA Cup but not after being given an almighty fright by their League One opponents.
As he has throughout the competition, Aitor Karanka named a strong starting line-up, although there were changes from his normal league 11.
Michael Appleton made just one change from the starting 11 in the game they lost 2-0 at home to Southend on Tuesday night, with Kane Hemmings replacing Liam Sercombe who dropped to the bench.
Boro should have been a goal down with just less than 90 seconds played as Bernardo was outmuscled by Antonio Martinez Lopez as they contested possession midway inside the Boro half. With Kane Hemmings racing unmarked through middle for support, Lopez had the simple option of passing to his left. He didn’t, Brad Guzan fashioned a save from a narrowing angle, although he couldn’t hold on, the ball was bundled around for a corner and the chance was lost.
Just a few minutes later Rudy Gestede peeled away to the back post to meet a cross and a header almost sneaked in at the near post, until Simon Eastwood, keeping up his ever-present record in his 44th game of the season got his left palm to the ball.
Viktor Fischer had a shot blocked then Grant Leadbitter clipped the top of the bar with a delicate chip from inside the penalty area, set up by the Dane.
Not long after an overhead kick from Lopez was more acrobatic than a goal threat, Stewart Downing was just wide with a low shot from the edge of the box.
Pouncing on a loose ball after a Gestede shot had been blocked, Calum Chambers went for goal from 22 yards and Eastwood did well to deal with a ball that bounced awkwardly in front of him.
With 25 minutes played Downing stole in to the penalty area just left of centre and was caught from behind Chris Maguire. A solitary protest from Maguire, not full-blooded at that, was all that followed and Grant Leadbitter slammed the penalty high into the net.
Oxford thought they had equalised when Maguire sent over a low cross from the right. It went straight in, but Hemmings was adjudged to have tripped Bernardo as the ball went through the area.
The next time the ball was in the net it stood.
With 34 minutes played Fabio sent over a deep cross from the left, one which he seemed to apologise for. Just beyond the back post Adama Traore knocked the ball back across, it deflected off centre-half Curtis Nelson and Rudy Gestede acrobatically cracked home his first goal in Boro colours just up from the six-yard box.
A smart spreading save from Eastwood turned round a low shot from Downing as Boro went for more, before a brief flurry around the edge of the Boro penalty area brought two free-kicks for Oxford in the closing minutes of the first half.
Half-time Middlesbrough 2 Oxford United 0
United won a corner with the first attack of the second half as Robert Hall tore away down the left to send over a cross that was turned behind.
Boro were soon back in rhythm, pressing the Oxford penalty area, though Downing scuffed a shot wide and Gestede couldn’t get the ball to run for him when getting in just ahead of Eastwood.
Determination from Traore won Boro a corner and that passage of play was symptomatic of Boro’s attitude in the game. They were the better side, but were working to prove the point.
Oxford went close to reducing the arrears with just short of an hour played when two corners in quick succession and a fizzing shot/cross was deflected just wide.
That came at the start of a passage of play where Boro were pushed back, Ayala was shown the yellow card, the visitors pulled a goal back and within a minute of that were level.
They were handed a chance to get a foothold in the game with another clumsy challenge from Traore in the D and leading scorer Chris Maguire curled over the wall and beyond Brad Guzan.
Less than a minutes later and what had looked so unlikely for much of the game came about as United drew level. Pouring forward they attacked down the left, Guzan could only parry a low shot from Maguire and Antonio Martinez Lopez tucked in the loose ball.
After settling, Boro took the game back to Oxford and a flashing cross from Fabio whistled through the six-yard box begging for a touch.
A double change with 71 minutes played wasn’t met with universal acceptance by all the Boro fans as Traore and Fischer were replaced by Cristhian Stuani and Gaston Ramirez.
Two Oxford subs combined with just over five minutes of normal time remaining and weren’t too far away from putting the visitors in front, as Sercombe got the better of Chambers to set up Conor McAleny shot wide.
It was two more subs who settled this absorbing cup-tie just a minute later when Alvaro Negredo failed to connect with an attempted overhead kick but did enough to help set up Cristhian Stuani who tapped in from closer range at the back post.
Full-time Middlesbrough 3 Oxford United 2
Scorers Leadbitter 26 (pen), Gestede 34, Maguire 64, Lopez 65, Stuani 86.
Middlesbrough: Guzan; Chambers, Ayala, Bernardo, Fabio, Traore (Stuani 71), Clayton, Leadbitter (Capt.), Fischer (Ramirez 71), Downing, Gestede (Negredo 85). Subs: Valdes (gk); Gibson, De Roon, Bamford. Order of subs on 71: 1) Stuani 2) Ramirez
Oxford United: Eastwood; Edwards, Dunkley, Nelson, Johnson, Hemmings (McAleny 64), Lundstram (Capt.), Ledson, Maguire, Hall, Martinez Lopez (Sercombe 84). Subs: Agboola (gk); Skarz, Ruffels, Rothwell, Raglan.
Referee Andre Marriner. West Midlands.
Boro Ayala 61, foul; Chambers 70, Negredo 90+2
Oxford United Ledson 76, foul; Johnson 90+4, throwing the ball away
Conditions Mild, overcast and breezy
Attendance 28,198 (3,376 Oxford)
mfc.co.uk Man of the Match Grant Leadbitter