Gabriel Jesus scored a dramatic late equaliser to salvage a 2-2 draw for Manchester City at Middlesbrough and put a further dent in the Teessiders' slim hopes of avoiding relegation from the Premier League.
Fourth-placed City had the chance to go three points clear of local rivals Manchester United, who drew 1-1 with Swansea City earlier on Sunday, but Pep Guardiola's side were somewhat fortunate to emerge from a closely contested game with a share of the points.
The visitors unsurprisingly had a stranglehold on possession at a sunny Riverside Stadium, but they came up against a well-organised Middlesbrough team who impressed as much with their fast breaks as with their resolute defending.
And Steve Agnew's men had a deserved lead when Alvaro Negredo scored against his old club in the 38th-minute, firing home his ninth goal of the season to equal his goal tally as a City player in the 2013-14 season.
Sergio Aguero, who limped off late in the match, scored a controversial penalty to haul City level after Marten de Roon was harshly judged to have fouled Leroy Sane in the penalty area, but Calum Chambers pounced on a loose ball in a goalmouth scramble in the 77th minute to restore Boro's lead.
But with the Riverside faithful preparing to celebrate a priceless win, Jesus headed Aguero's cross into the net to earn his side a point towards their push for a top-four finish, while Boro are six points adrift of safety with just three games to play.
City almost had the lead in the first minute, but Jesus failed to apply the finishing touch to Aguero's flashed pass across the face goal.
At the other end, Negredo was perhaps thankful an offside flag was raised when he saw a presentable effort saved by Willy Caballero.
The visitors created the better early openings and Aguero curled a shot just over the bar.
But Boro remained a threat and Negredo wastefully lashed another opportunity wide from close range.
Fernandinho was perhaps fortunate to escape a booking when he appeared to elbow Adam Clayton, before De Roon lofted a shot over the crossbar when Vincent Kompany failed to clear his lines.
City did go behind in the 38th minute, though, as Boro were rewarded for their hard work.
Stewart Downing burst down the left and his low cross reached Negredo, who slipped as he fired a left-foot shot that went in off the left post.
Pep Guardiola sent on Raheem Sterling and Sane early in the second half but it was the home side who nearly regained the lead with Clayton's 20-yard shot forcing a diving save from Caballero after good work by Fabio.
Clayton blocked a Sterling shot at the other end shortly after as City pressed for an equaliser and Brad Guzan saved powerful drives from both Kevin de Bruyne and Sane.
The equaliser arrived in controversial fashion in the 68th minute, though, as Sane went down easily under a challenge by De Roon and the referee pointed to the penalty spot.
Middlesbrough protested furiously and Fabio was booked in the melee, but Aguero kept his cool and powered the penalty to the left of Guzan, who dived the wrong way.
Boro substitute Adama Traore was brought down by Nicolas Otamendi as Middlesbrough sought a late winner, and after Downing's free-kick was parried by Caballero the ball was played back into the area where Chambers bundled it into the net.
But, with just five minutes left on the clock, Aguero - who was later substituted with a seeming groin injury - was allowed time and space to send over a looping cross and Jesus was left unmarked to head home the fourth goal of his Manchester City career.