Paris Saint-Germain moved level on points with Ligue 1 leaders Monaco but Unai Emery's side needed a dramatic injury-time winner to triumph 3-2 at Metz despite having led 2-0 with 12 minutes to play.
Edinson Cavani and Blaise Matuidi gave PSG a comfortable lead as the visitors controlled the opening half on Tuesday, and with time ticking down there was little sign of the dramatic denouement to come.
But substitute Yann Jouffre bent in a delightful free-kick to get the home side back into the game and another replacement, Cheick Diabate, turned home a low cross to complete what appeared to be a brilliant comeback for the relegation-threatened hosts.
Jouffre then hit the crossbar with an injury-time set-piece from similar range in a sensational finale at the Stade Saint-Symphorien, but the drama was not over there as Javier Pastore's cross was superbly headed home by Matuidi.
Leaders Monaco have a game in hand over PSG, but collecting an eighth successive away league win in such stunning fashion could prove to be a decisive moment in the title race.
Matuidi and Cavani had early efforts blocked as Emery's men made a bright start, but the first clear opportunity was missed by PSG after 23 minutes.
Maxwell's low left-wing cross looked to have provided Lucas Moura with a straightforward finish at the back post, but the Brazilian got his effort badly wrong and sidefooted back across goal.
The dominant visitors did take the lead after 33 minutes, however, from another left-wing centre.
Maxwell provided the delivery again after Metz were cut open too easily and the floated cross was powered home from close range by Cavani for the striker's 30th league goal of the season.
30 - With his goal against Metz, Edinson Cavani became the first player in the Top 5 European leagues to score 30 goals in 2016-17. Matador. — OptaJavier (@OptaJavier) April 18, 2017
And Maxwell continued to be the main creative spark for PSG as he soon fashioned a second.
Matuidi timed his forward run perfectly to burst on to the left-back's throughball and the France international's low finish beat goalkeeper Eiji Kawashima at his near post.
Metz mustered a single shot in the first half but they went close to halving the deficit immediately after half-time when Cheick Doukoure fired narrowly wide with Kevin Trapp scrambling.
Lucas almost made amends for his poor early miss with a brilliant bustling run into the box, but the second half lacked quality as PSG tried to make sure of the points with a more defensive shape.
Diabate bent a shot narrowly wide after 73 minutes, then Jouffe's superb effort sparked life into the match.
The midfielder had only been on the pitch for two minutes but he beat Trapp from a central position 25 yards out with a beautiful dipping effort and Diabate got enough on Ismaila Sarr's cross to equalise with two minutes to go.
PSG were not finished, however, with Matuidi timing his leap to perfection to thump in a brilliant header from Pastore's right-wing cross to spark delirium for the visitors.