Leeds advanced to the fifth round of the FA Cup, with sights set on a possible first quarter-final place since 2002-03. But after scoring a last-gasp equaliser to take the tie to extra time and then a penalty shootout, Birmingham could draw some consolation from pushing their top-flight opponents.

Sean Longstaff scored the clinching penalty, after Patrick Roberts, who had scored in the 89th minute to earn Birmingham parity, blasted his over the crossbar. Lucas Perri also saved from Tommy Doyle, who was probably man of the match.

Leeds’s first season back in the Premier League has gone increasingly well and this made it one defeat in seven matches – and that against the leaders, Arsenal – and here they showed the depth of character to come back from an appalling start to the game.

While Leeds’s first-half performance suggested they thought they were turning up for a Sunday league match, Chris Davies’s team were well up for the Cup, as they used to say in the times when Birminghamused to play in these penguin-style shirts.

Jay Stansfield was influential as the Championship side took control. Birmingham’s top scorer appeared to have reduced his angle when he took one touch to his left, in the 11th minute, but then produced a superb left-footed half volley that would have nestled in the top corner if Perri, Leeds’s deputy goalkeeper, had not tipped the ball on to the inside of the post.