Paris Saint-Germain will take a 2-1 lead into the second leg of their Champions League last-16 tie against Valencia, but a dramatic late turn of events handed the Spanish side a lifeline.
Going into the 90th minute here at the Mestalla on Tuesday, the French league leaders appeared in cruise control thanks to first-half goals from Ezequiel Lavezzi and Javier Pastore.
However, French international centre-back Adil Rami found the net in the final minute to keep Valencia in the tie, before PSG had Zlatan Ibrahimovic controversially sent-off for a studs-up challenge on Andres Guardado.
The Swede, who has been criticised in the past for failing to produce his very best in the Champions League knockout stages, will now miss the return leg at the Parc des Princes next month, but at least PSG will have a lead to defend in that game.
"Ibrahimovic did not deserve the red card. I don't understand the decision," an unhappy PSG coach Carlo Ancelotti told French Canal Plus television at full-time.
Despite the ending, for much of the evening this was a classic away European performance from Ancelotti's side, who ceded possession to their hosts but were always a threat on the counter-attack.
"We played well and had chances to score more goals," added the Italian.
"It was a good team performance, but this was just the first leg. There is still the return to come."
History suggested that this would be a major test for PSG, who were playing a knockout tie in Europe's top club competition for the first time since 1995.
Since then, Valencia had reached two Champions League finals, and had never been beaten by French opposition at their Mestalla home.
However, PSG, backed by massive investment from their Qatari owners, are emerging as a major continental force, and they travelled to Spain with their confidence buoyed by a run of 12 matches unbeaten in all competitions.
Valencia have considerably improved since Ernesto Valverde took over as coach two months ago, and they had held Barcelona to a 1-1 draw in their last home outing.
However, they got off to a nightmare start to this game, with the lively Lucas Moura crashing a shot from 25 yards off the post as a prelude to the visitors' opening goal.
Lavezzi has been outstanding during PSG's superb recent run, and it was no great surprise to see the Argentine break the deadlock as he played a lovely one-two with Pastore before sending in a shot that Vicente Guaita in the home goal really should have kept out.
PSG allowed Valencia to dominate possession after that, but they were always a menace on the break, especially down the home side's left, where the attack-minded Guardado had been forced to fill in with Aly Cissokho and Jeremy Mathieu both injured.
Valencia fell further behind when Lucas turned the unfortunate Guardado inside-out on the right flank before picking out Pastore, whose first-time shot was too good for Guaita.
Valverde made a double change at half-time, with Sergio Canales and Nelson Valdez replacing Ever Banega and Jonas, but the pattern of the game remained much the same.
The Spanish side had plenty of the ball, but PSG came closest to scoring again, with Lavezzi squandering a glorious chance after being picked out by a brilliant Marco Verratti pass.
Ibrahimovic almost netted a classy third goal after a one-two with substitute Clement Chantome, who then saw his follow-up effort disallowed for offside.
But Valencia finally found a route back into the contest as Rami appeared unmarked in the area to head home a trademark dead-ball delivery from Tino Costa before Ibrahimovic was given his marching orders.