Gabriel Jesus’s header five minutes from time saw Manchester City to a 2-2 draw at relegation-threatened Middlesbrough on Sunday as his side stayed just ahead in the race for a Champions League spot.

City twice had to come from behind against a Boro side who could be demoted to the second-tier after the next round of Premier League fixtures.

But the way the northeast club rattled Pep Guardiola’s men showed they were not prepared to give up their top-flight status without a fight.

Former City striker Alvaro Negredo put Boro ahead seven minutes before half-time at the Riverside, only for Sergio Aguero to convert a controversial penalty with 21 minutes remaining when Leroy Sane hit the ground after a challenge from Marten de Roon.

But Middlesbrough rallied and restored the lead when Calum Chambers, on loan from Arsenal, grabbed his first goal for the club in the 77th minute.

However, there was still time for Jesus to earn City a draw that kept them in the fourth and final Champions League place on offer to English clubs, a point clear of local rivals Manchester United, who remained fifth after a 1-1 draw at home to Swansea earlier on Sunday.

Both Manchester clubs have four league games left to play this season.

Even though Middlesbrough boast an impressive home record against Manchester City at the top level, it was always going to be difficult given their respective positions in the Premier League.

City’s only league win in 40 years on Teesside was 10 years ago, but they must have fancied their chances more given Middlesbrough’s descent towards the Championship in 2017.

Steve Agnew, the Middlesbrough head coach, left out Gaston Ramirez, who wanted away in January and has frustrated ever since, completely, while Guardiola sprang a surprise by including both Jesus and Aguero up front

The attacking pair came within inches of combining to score an opener inside 70 seconds too.

Aguero got to the byline and drilled a low cross through the six-yard area where Jesus was unable to turn beyond goalkeeper Brad Guzan.

Middlesbrough, buoyed by the midweek victory over relegated local rivals Sunderland, showed a desire to attack their more illustrious opponents.

Negredo dragged a half-volley across goal from an unmarked position when Fabio da Silva’s cross found its way to him, while de Roon saw a long-range shot shave the side netting.