In a frantic, fantastic match in the Spanish capital between sides that were dazzling in attack but vulnerable at the back, the Reds saw an early two-goal lead wiped out by Antoine Griezmann’s double.
The France forward was then shown a straight red card early in the second half, allowing the visitors to reassert their authority and snatch a big win through Salah’s well-taken penalty, awarded for a clumsy barge on Diogo Jota by Mario Hermoso.
Jota almost turned villain, though, as his challenge on Jose Maria Gimenez resulted in a penalty being awarded – only for the referee to change his mind after being encouraged by VAR to view the incident on the pitchside monitor.
Earlier, Salah had given the Reds the lead when his low finish at the end of a weaving run found the net off the toe of James Milner before Naby Keita’s brilliant volley doubled the visitors’ advantage.
Griezmann’s neat close-range finish then superb turn and shot across Alisson restored parity, all before the break.
But the last word went to Salah, who is now Liverpool’s record goalscorer in the Champions League – his two goals taking him to 31, one more than Steven Gerrard.