Remember Paris, Pep Guardiola had cautioned after his Manchester City team’s 3-1 first-leg victory at Old Trafford in this Carabao Cup semi-final. Remember Paris, Ole Gunnar Solskjær had trumpeted in the countdown to the second leg. It could be done. His Manchester United had done it before – in last season’s Champions League last 16 when they overturned a two-goal deficit from the home leg to upset Paris Saint-Germain in frankly ludicrous fashion.

This game should not have been close. City’s superiority was plain for so long but a combination of United’s doggedness and their own profligacy ensured that it went down to the wire. City had two goals ruled out for offside and some of their misses had Guardiola and the home support contorting in agony.

Manchester City 0-1 Manchester United (3-2 agg): Carabao Cup semi-final, second leg – as it happened Read more

The most ridiculous one came in the 73rd minute when Sergio Agüero robbed Harry Maguire inside the United six-yard box and the substitute, David Silva, opted not to shoot but to pass to Ilkay Gündogan. He then tried to run through two United defenders rather than passing or shooting and the chance went begging. It was not the only example of City’s infuriating habit of wanting to walk the ball into the net and failing.

Nemanja Matic’s bolt from the blue on 35 minutes had advertised a United comeback to rival the one in Paris and when Fred and the substitute Andreas Pereira stood over an 87th-minute free-kick on the edge of the City area, following a reckless foul by Nicolás Otamendi on Maguire, Guardiola and everybody in sky blue felt theirhearts thump.

Matic had been sent off by then for checking Gündogan – a second bookable offence – but here was the chance to take the tie to penalties. Where was Juan Mata, another substitute? According to Solskjær, he had deferred to Fred, who had been on fire in free-kick practice on Tuesday. Up stepped Fred and into the wall the shot went. Really, it would have been too much.

Facebook Twitter Pinterest Nemanja Matic is sent off for a second yellow card in the 76th minute. Photograph: Paul Ellis/AFP via Getty Images

And so City advanced to the final against Aston Villa and Guardiola could contemplate the chance to win this competition for a third season in succession. He has only lost one tiein it – coincidentally to United in October 2016.

Nobody could say that City did not deserve it, particularly after the way they had dominated the first half of the first leg when they streaked into a three-goal lead, but Solskjær was in a position to take the positives.

Even though the gulf in quality between the teams was pronounced on the night United defended well, they showed a steely attitude and they gave themselves a puncher’s chance of getting to penalties.

Salah and Oxlade-Chamberlain sink West Ham to keep Liverpool rolling on Read more

It was the second time in as many months that United had won here, following the 2-1 Premier League victory on 7 December and, although it did not feel like a victory, Solskjær was quick to point out that it showed what could be achieved when his players executed a gameplan. United’s record against Guardiola’s City at the Etihad now reads W3 D1 L1.

Guardiola wanted to guard against United’s pace up front and, moreover, he wanted to hog the ball, to control the occasion. His 3-2-4-1 formation was innovative, featuring two full-backs, Kyle Walker and João Cancelo, in the back three and, further forward, Kevin De Bruyne and Bernardo Silva in the spaces behind Agüero.

City dominated the opening half-hour and, were it not for David de Gea, they would have been in front within 10 minutes. First the United goalkeeper sprang to his right to keep out an Agüero header following Bernardo Silva’s dinked ball over the top and then he blocked Riyad Mahrez’s deflected shot with his legs. There was more. De Gea turned away an Agüero shot that was bound for the top corner and Maguire had to stretch into a saving challenge on Raheem Sterling after De Bruyne’s beautifully curled through-ball.

Facebook Twitter Pinterest Raheem Sterling turns the ball into the net only for the goal to be ruled out for offside. Photograph: Laurence Griffiths/Getty Images

United survived. And then they prospered. They knew they had to score the opening goal and, when they did, it was quite the strike from Matic. He got his body shape right in a heartbeat after Fred’s free-kick had flicked off Bernardo Silva’s head to steer a side-on, first-time effort inside the near corner from just inside the area. Game on.

Sterling had a goal ruled out for offside in the 42nd minute following a De Bruyne cross but, by then, City could feel the nerves jangling. Sterling had allowed a pass to slide under his studs and trickle out for a throw-in. The home crowd howled.

United worked their way through the City press a couple of times in the first half without finding a final pass but they sensed that their rivals could be vulnerable.

Guardiola’s team defended best when they dominated the ball and kept it a long way from their goal. When they actually had to defend they looked jittery. A case in point came early in the second half from another United set piece. Maguire rose high only to thump a header off-target – a fine chance wasted.

City needed the soothing balm of a goal and Sterling should have scored it when he raced on to the outstanding De Bruyne’s pass. Yet he dallied, skated square, away from challenges, before blasting high.

Agüero had a goal chalked off for a hairline offside call on 84 minutes as United clung on. This time, though, there would be no miracle endingfor them.